openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

jdk22 OpenJDK StackWalker/CallerSensitiveMethod - Expected class jdk.test.CallerSensitiveTest but got [class java.util.CSM]

Open pshipton opened this issue 1 year ago • 7 comments

https://openj9-jenkins.osuosl.org/job/Test_openjdk22_j9_sanity.openjdk_aarch64_mac_Personal_testList_0/1/ jdk_lang java/lang/StackWalker/CallerSensitiveMethod/Main.java

16:04:08  ERROR: Expected class jdk.test.CallerSensitiveTest but got [class java.util.CSM]
16:04:08  java.lang.UnsupportedOperationException: Stack walker configured with DROP_METHOD_INFO
16:04:08  	at java.base/java.lang.StackWalker$StackFrameImpl.ensureMethodInfo(StackWalker.java:431)
16:04:08  	at java.base/java.lang.StackWalker$StackFrameImpl.toStackTraceElement(StackWalker.java:482)
16:04:08  	at java.base/java.lang.StackWalker$StackFrameImpl.toString(StackWalker.java:512)
16:04:08  	at java.base/java.lang.String.valueOf(String.java:5285)
16:04:08  	at csm/jdk.test.CallerSensitiveTest.lambda$checkNonCSMCaller$0(CallerSensitiveTest.java:147)
16:04:08  	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1709)
16:04:08  	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:782)
16:04:08  	at csm/jdk.test.CallerSensitiveTest.checkNonCSMCaller(CallerSensitiveTest.java:147)
16:04:08  	at csm/jdk.test.CallerSensitiveTest.invokeMethod(CallerSensitiveTest.java:111)
16:04:08  	at csm/jdk.test.CallerSensitiveTest.main(CallerSensitiveTest.java:73)

Perhaps related to https://github.com/eclipse-openj9/openj9/issues/18697

pshipton avatar Jan 05 '24 23:01 pshipton

@keithc-ca

pshipton avatar Jan 05 '24 23:01 pshipton

the cause of this is due to missing update to the walkState pointer allocated https://github.com/eclipse-openj9/openj9/blob/master/runtime/jcl/common/java_lang_StackWalker.cpp#L106 which allowed flags/data from previous walkState to be used during stack walking. I will open a PR to fix this shortly.

fengxue-IS avatar Feb 08 '24 20:02 fengxue-IS

Tests to be unexcluded via https://github.com/adoptium/aqa-tests/pull/5066.

keithc-ca avatar Feb 14 '24 20:02 keithc-ca

Reopen since https://github.com/eclipse-openj9/openj9/pull/18926 was reverted.

pshipton avatar Feb 15 '24 14:02 pshipton

@pshipton Do you think we should re-exclude the test, i.e. revert https://github.com/adoptium/aqa-tests/pull/5066?

keithc-ca avatar Feb 15 '24 15:02 keithc-ca

Yes, it would be nice to have clean jdk22 builds again.

pshipton avatar Feb 15 '24 16:02 pshipton

See https://github.com/adoptium/aqa-tests/pull/5072.

keithc-ca avatar Feb 15 '24 16:02 keithc-ca