maintainer-feedback requested: [Bug 265284] java/openjdk18: wont run or build running on VMWare running on M1 Mac Mini

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 17 Jul 2022 23:46:49 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-java (Nobody)
<java@FreeBSD.org> for maintainer-feedback:
Bug 265284: java/openjdk18: wont run or build running on VMWare running on M1
Mac Mini
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265284



--- Description ---
Hardware: Apple Mac Mini M1
VMWare Fusion: 19431034 (Preview 21H1)
Pkg: openjdk11-11.0.15+10.1

Java (openjdk11) crashes when launched on FreeBSD 13.1 running under
virtualization using VMWare on an M1 Mac. Simply running "java" causes the
crash to happen. Compiling from ports is apparently not possible (tried
openjdk11 and 18) because the bootstrappers themselves crash, breaking the
configure scripts.

Steps:
1. Create a virtual machine and install FreeBSD 13.1 aarch64.
2. Install openjdk11 using "pkg install openjdk11".
3. Run "java".

Result:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x000000004ad9b190, pid=90863, tid=113952
#
# JRE version:	(11.0.15+10) (build )
# Java VM: OpenJDK 64-Bit Server VM (11.0.15+10-1, mixed mode, tiered,
compressed oops, g1 gc, bsd-aarch64)
# Problematic frame:
# v  ~BufferBlob::native signature handlers
#
# Core dump will be written. Default location:
/usr/ports/java/openjdk18/java.core
#
# An error report file with more information is saved as:
# /usr/ports/java/openjdk18/hs_err_pid90863.log
Could not load hsdis-aarch64.so; library not loadable; PrintAssembly is
disabled
#
#
Abort (core dumped)

I tried to install the same versions of FreeBSD and OpenJDK on QEMU running
under emulation and on a Raspberry Pi 3 Model B. Both work fine ("java"
launches and prints the long "usage" message).