Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Test failures on Apple silicon (aarch64) #1323

Closed
dkocher opened this issue Mar 6, 2021 · 5 comments · Fixed by #1419
Closed

Test failures on Apple silicon (aarch64) #1323

dkocher opened this issue Mar 6, 2021 · 5 comments · Fixed by #1419

Comments

@dkocher
Copy link
Contributor

dkocher commented Mar 6, 2021

Running the tests on M1 currently leads to JVM crashes for some tests. Find attached two sample reports.

hs_err_pid14955.log
hs_err_pid14919.log

Provide complete information about the problem

openjdk version "16" 2021-03-16
OpenJDK Runtime Environment (build 16+14)
OpenJDK 64-Bit Server VM (build 16+14, mixed mode)

@matthiasblaesing
Copy link
Member

To my knowledge aarch64 has not yet hit mainline, so this is not an official java image. I remember, that there were crashes reported, but attributed to the JVM. To be frank: This needs someone with knowledge in C, libffi and access to apple silicon (which won't be me).

@dkocher
Copy link
Contributor Author

dkocher commented Oct 2, 2021

I have tested this with

     [echo] Java version 17, compatibility: 9, ant: 17
     [echo] JNA version 5.10.0-SNAPSHOT, native 6.1.1, android 5100000
     [echo] OpenJDK 64-Bit Server VM (Eclipse Adoptium, 17+35)
     [echo] java.home=/Users/dkocher/Library/Java/JavaVirtualMachines/jdk-17+35.jdk/Contents/Home
     [echo] java.library.path=/Users/dkocher/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
     [echo] os.prefix=darwin-aarch64
     [echo] os.name=Mac OS X
     [echo] os.arch=aarch64 (little)

which gives the following 2 errors in test results

    [junit] Testcase: com.sun.jna.DirectCallbacksTest:testUnionByValueCallbackArgument:	Caused an ERROR
    [junit] Testcase: com.sun.jna.different_package.PrivateDirectCallbacksTest:testCallVoidCallback:	Caused an ERROR

with both stack traces pointing to ffi_prep_closure_loc

Stack: [0x000000016b12c000,0x000000016b32f000],  sp=0x000000016b32cc40,  free space=2051k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x4e24a4]  JNI_ArgumentPusher::JNI_ArgumentPusher(Method*)+0x20
V  [libjvm.dylib+0x4c9d94]  jni_CallVoidMethod+0x10c
C  [jna16579415408252642020.tmp+0x10044]  ffi_prep_closure_loc+0x1788
C  [jna16579415408252642020.tmp+0xe82c]  ffi_call+0x500
C  [jna16579415408252642020.tmp+0xd61c]  JNA_callback_dispose+0x4d8
C  [jna16579415408252642020.tmp+0xcd90]  create_callback+0x798
C  [jna16579415408252642020.tmp+0xed34]  ffi_prep_closure_loc+0x478
C  [jna16579415408252642020.tmp+0x101b4]  ffi_prep_closure_loc+0x18f8
C  [jna16579415408252642020.tmp+0x10044]  ffi_prep_closure_loc+0x1788
C  [jna16579415408252642020.tmp+0xe82c]  ffi_call+0x500
C  [jna16579415408252642020.tmp+0xb2a4]  Java_com_sun_jna_Native_registerMethod+0xe88
C  [jna16579415408252642020.tmp+0xed34]  ffi_prep_closure_loc+0x478
C  [jna16579415408252642020.tmp+0x101b4]  ffi_prep_closure_loc+0x18f8
j  com.sun.jna.different_package.PrivateDirectCallbacksTest$DirectPrivateWithCallbackArgumentTestLibrary.callVoidCallback(Lcom/sun/jna/different_package/PrivateDirectCallbacksTest$PrivateWithCallbackArgumentTestLibrary$VoidCallback;)V+0
j  com.sun.jna.different_package.PrivateDirectCallbacksTest.testCallVoidCallback()V+22

It seems #1378 does not make any difference here.

@dkocher
Copy link
Contributor Author

dkocher commented Nov 7, 2021

To my knowledge aarch64 has not yet hit mainline, so this is not an official java image. I remember, that there were crashes reported, but attributed to the JVM. To be frank: This needs someone with knowledge in C, libffi and access to apple silicon (which won't be me).

I suppose with 17+35 we can no longer blame the JDK. I am happy to provide any resources required like access to a M1 for anyone who wants to tackle this.

@dkocher
Copy link
Contributor Author

dkocher commented Mar 15, 2022

I can confirm the referenced test cases above are now ✅ with this changeset running on

     [echo] Java version 17.0.2, compatibility: 9, ant: 17
     [echo] JNA version 5.11.0-SNAPSHOT, native 6.1.2, android 5110000
     [echo] OpenJDK 64-Bit Server VM (Eclipse Adoptium, 17.0.2+8)
     [echo] java.home=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
     [echo] java.library.path=/Users/dkocher/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
     [echo] os.prefix=darwin-aarch64
     [echo] os.name=Mac OS X
     [echo] os.arch=aarch64 (little)

The only remaining test failure is com.sun.jna.NativeLibraryTest.testAvoidDuplicateLoads.

@dkocher
Copy link
Contributor Author

dkocher commented Mar 15, 2022

The only remaining test failure is com.sun.jna.NativeLibraryTest.testAvoidDuplicateLoads.

In #1423.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants