[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

            Bug ID: 243265
           Summary: emulators/qemu-user-static: qemu-aarch64-static SIGILL
                    with openjdk11-bootstrap
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: [hidden email]
          Reporter: [hidden email]
          Assignee: [hidden email]
             Flags: maintainer-feedback?([hidden email])

I'm trying to crossbuild java/openjdk11 on FreeBSD-12/amd64 for
ARCH=aarch64. All dependencies have been built successfully, but the
build of java/openjdk11 is currently failing when the port attempts to
run "/usr/local/bootstrap-openjdk11/bin/java -version" from the
(just-built) java/bootstrap-openjdk11.

To reproduce, grab the aarch64 bootstrap from:
http://distcache.freebsd.org/local-distfiles/glewis/bootstrap-openjdk11/bootstrap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz

On a RPI3, it works as expected:
rpi3:~,10:23pm> tar xf bootstrap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz
rpi3:~,10:23pm> bootstrap-openjdk11/bin/java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-1)
OpenJDK 64-Bit Server VM (build 11.0.5+10-1, mixed mode)

But on my aarch64 crossbuild environment:
root@onyx:/tmp # tar xf bootstrap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz
root@onyx:/tmp # bootstrap-openjdk11/bin/java -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000004003fa4454, pid=4506, tid=101995
#
# JRE version:  (11.0.5+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.5+10-1, mixed mode, sharing, tiered,
compressed oops, serial gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.so+0xb01454]  JVM_RaiseSignal+0x3e2158
#
# Core dump will be written. Default location: /tmp/java.core
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid4506.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Segmentation fault (core dumped)

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

maintainer-feedback requested: [Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
Bugzilla Automation <[hidden email]> has asked freebsd-emulation mailing
list <[hidden email]> for maintainer-feedback:
Bug 243265: emulators/qemu-user-static: qemu-aarch64-static SIGILL with
openjdk11-bootstrap
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265



--- Description ---
I'm trying to crossbuild java/openjdk11 on FreeBSD-12/amd64 for
ARCH=aarch64. All dependencies have been built successfully, but the
build of java/openjdk11 is currently failing when the port attempts to
run "/usr/local/bootstrap-openjdk11/bin/java -version" from the
(just-built) java/bootstrap-openjdk11.

To reproduce, grab the aarch64 bootstrap from:
http://distcache.freebsd.org/local-distfiles/glewis/bootstrap-openjdk11/bootstr
ap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz

On a RPI3, it works as expected:
rpi3:~,10:23pm> tar xf bootstrap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz
rpi3:~,10:23pm> bootstrap-openjdk11/bin/java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-1)
OpenJDK 64-Bit Server VM (build 11.0.5+10-1, mixed mode)

But on my aarch64 crossbuild environment:
root@onyx:/tmp # tar xf bootstrap-openjdk11-aarch64-12-11.0.5.10.1.tar.xz
root@onyx:/tmp # bootstrap-openjdk11/bin/java -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000004003fa4454, pid=4506, tid=101995
#
# JRE version: (11.0.5+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.5+10-1, mixed mode, sharing, tiered,
compressed oops, serial gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.so+0xb01454]  JVM_RaiseSignal+0x3e2158
#
# Core dump will be written. Default location: /tmp/java.core
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid4506.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Segmentation fault (core dumped)
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

Steven Hartland <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #1 from Steven Hartland <[hidden email]> ---
It sounds like your actually trying to run the java built for aarch64 on your
amd64 machine?

If this is the case it won't work, as the java build will include instructions
for the target arch not the builders arch.

The SIGILL signal is sent to a process when it attempts to execute an illegal,
malformed, unknown, or privileged instruction.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

--- Comment #2 from Jonathan Chen <[hidden email]> ---
It's a crossbuild environment, used to build binaries for aarch64 on an amd64
host; with the help of binmiscctl and qemu-aarch64-static.

All the other aarch64 dependancies for openjdk11 have been built. The only one
that's failing to build is java/openjdk11 itself; and I've tracked it down to
SIGILL being generated by qemu-aarch64-static.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

[hidden email] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #3 from [hidden email] ---
duplicate bug #240037

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

Jonathan Chen <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Closed
         Resolution|---                         |DUPLICATE

--- Comment #4 from Jonathan Chen <[hidden email]> ---


*** This bug has been marked as a duplicate of bug 240037 ***

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

--- Comment #5 from Jonathan Chen <[hidden email]> ---
Workaround described in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240037#c2 can possibly be
applied to src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp in order
to build a new bootstrap.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

--- Comment #6 from [hidden email] ---
Created attachment 210756
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=210756&action=edit
patch

Can you try the attached patch (it's for
/usr/ports/emulators/qemu-user-static-devel).
It seems to work here, I tried with this program but I haven't checked if the
returned value are sane:

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <machine/armreg.h>
#include <machine/_stdint.h>

int
main(int argc, char **argv)
{
        uint64_t id_aa64isar0, id_aa64pfr0;
        id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_EL1);
        id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_EL1);

        printf("id_aa64isar0: 0x%lx, id_aa64pfr0: 0x%lx\n", id_aa64isar0,
id_aa64pfr0);
        return (0);
}

./identcpu
id_aa64isar0: 0x111110012120, id_aa64pfr0: 0x110000

I haven't tried qemu-user-static.

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

Jonathan Chen <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Closed                      |Open
         Resolution|DUPLICATE                   |---

--- Comment #7 from Jonathan Chen <[hidden email]> ---
With the patch applied, the bootstrap check completes; but the synth package
builder fails further down the track with:

qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x61f9f288
/usr/local/bin/bash: line 1: 62054 Abort trap              (core dumped)
/usr/local/bootstrap-openjdk11/bin/javac -g -J-XX:+UseSerialGC -J-Xms32M
-J-Xmx512M -J-XX:TieredStopAtLeve
l=1 -source 9 -target 9 -XDignore.symbol.file=true -g
-Xlint:all,-deprecation,-options -Werror -Xprefer:source -implicit:none -d
/construction/xports/java/openjdk11/work/openjdk-j
dk11u-jdk-11.0.5-10-1/build/bsd-aarch64-normal-server-release/buildtools/langtools_tools_classes
@/construction/xports/java/openjdk11/work/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd
-aarch64-normal-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.tmp
> >(/usr/bin/tee -a /construction/xports/java/openjdk11/work/openjdk-jdk11u-
jdk-11.0.5-10-1/build/bsd-aarch64-normal-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.log)
2> >(/usr/bin/tee -a /construction/xports/java/ope
njdk11/work/openjdk-jdk11u-jdk-11.0.5-10-1/build/bsd-aarch64-normal-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch.log
>&2)

...
=== Output from failing command(s) repeated here ===
* For target
buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch:
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x61f9f288
* For target
hotspot_variant-server_buildtools_tools_classes__the.BUILD_JFR_TOOLS_batch:
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x6268e888
* For target hotspot_variant-server_tools_jvmti__the.BUILD_JVMTI_TOOLS_batch:
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x62683788

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

[Bug 243265] emulators/qemu-user-static: qemu-aarch64-static SIGILL with openjdk11-bootstrap

bugzilla-noreply
In reply to this post by bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243265

--- Comment #8 from [hidden email] ---
yeah, that's a different bug

--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "[hidden email]"