Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Test failures on Linux AMD64 #119

Open
phi-gamma opened this issue Feb 8, 2023 · 1 comment · May be fixed by #120
Open

Test failures on Linux AMD64 #119

phi-gamma opened this issue Feb 8, 2023 · 1 comment · May be fixed by #120

Comments

@phi-gamma
Copy link

Hi, both on current master and on the 0.7.0 tag two tests fail for me
with these backtraces:

Tests run: 33, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.049 sec <<< FAILURE! - in org.bridj.DemanglingTest
testIntVsPointer_32bits(org.bridj.DemanglingTest)  Time elapsed: 0.005 sec  <<< ERROR!
java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers
	at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
	at org.bridj.util.ReflectionUtils.makeFieldWritable(ReflectionUtils.java:42)
	at org.bridj.util.PlatformTestUtils.forcePointerSize(PlatformTestUtils.java:21)
	at org.bridj.util.PlatformTestUtils.force32Bits(PlatformTestUtils.java:29)
	at org.bridj.DemanglingTest.testIntVsPointer_32bits(DemanglingTest.java:546)

testIntVsPointer_64bits(org.bridj.DemanglingTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.RuntimeException: java.lang.NoSuchFieldException: modifiers
	at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
	at org.bridj.util.ReflectionUtils.makeFieldWritable(ReflectionUtils.java:42)
	at org.bridj.util.PlatformTestUtils.forcePointerSize(PlatformTestUtils.java:21)
	at org.bridj.util.PlatformTestUtils.force64Bits(PlatformTestUtils.java:32)
	at org.bridj.DemanglingTest.testIntVsPointer_64bits(DemanglingTest.java:559)

From a look at the code, that absent field is SIZE.

My system:

$ uname -a
Linux styx 6.1.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 01 Feb 2023 17:07:39 +0000 x86_64 GNU/Linux

$ java --version
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 -Duser.language=en -Duser.country=US -Duser.timezone=UTC
openjdk 17.0.6 2023-01-17
OpenJDK Runtime Environment (build 17.0.6+10)
OpenJDK 64-Bit Server VM (build 17.0.6+10, mixed mode)

$ pacman -Q glibc
glibc 2.36-7

Let me know if you need more info.

@phi-gamma
Copy link
Author

phi-gamma commented Feb 10, 2023

From a look at the code, that absent field is SIZE.

Looks like I was mistaken. It’s actually this line that
crashes:

Field modifiersField = Field.class.getDeclaredField("modifiers");

Google led me to this answer
which in turn leads to this JVM commit
from 2018 that introduced screening of various fields on
account of their “sensitivity”. Thus the current approach
taken in makeFieldWritable can no longer work with
recent JVMs.

@phi-gamma phi-gamma linked a pull request Feb 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant