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

[23.0] Sync with upstream #633

Merged
merged 60 commits into from
Dec 13, 2023
Merged

Conversation

zakkak
Copy link
Collaborator

@zakkak zakkak commented Dec 12, 2023

Closes #618

I went through the changes and don't see anything concerning.

christianhaeubl and others added 30 commits October 16, 2023 10:04
Some cleanups and additional sanity checks.

(cherry picked from commit 6c0aa30)
Disable the stripping of debug symbols from the generated native bits

Closes oracle#6995

(cherry picked from commit 0162b22)
…f /json/list path. (GR-49664)

(cherry picked from commit de48c84)
… called from a host call.

(cherry picked from commit 0b14c1e)

Adapt fix to 23.0
… entered context during close called from a host call

PullRequest: graal/16015
(cherry picked from commit 514f292)
Some versions of `ld64` cannot deal with DIRECT8 relocations in the `.text` section. Approximately this is since version 820.1 (Xcode 14). Starting with Xcode15 beta3 the default linker has been replaced with "the new linker" (version 902.11) which does not suffer from this bug anymore.

However, Xcode also ships a `ld-classic` which reassembles "the old linker" and is still affected by this bug (and it of course prints the same version number).

See some more in-depth analysis of this ld64 bug in https://openradar.appspot.com/FB11942354

The workaround: Instead of emitting the address of a HostedMethod inlined, it will be put in the data section and thus requires a memory load to obtain it.

(cherry picked from commit e30698b)

resolve conflicts

resolve errors

backport fixup
(cherry picked from commit 6f02719)

fix error

add back method isAssociative()

remove unused imports

fix formatting issues
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 12, 2023
@zakkak zakkak requested a review from jerboaa December 12, 2023 13:37
@zakkak zakkak linked an issue Dec 12, 2023 that may be closed by this pull request
2 tasks
@zakkak
Copy link
Collaborator Author

zakkak commented Dec 12, 2023

Looking at build failure

@zakkak zakkak force-pushed the 2023-12-12-sync-23.0 branch from 15c098c to f3864b7 Compare December 12, 2023 14:15
@zakkak
Copy link
Collaborator Author

zakkak commented Dec 12, 2023

Looking at build failure

This was due to some conflicts with #575

Requested @roberttoyonaga's review in the corresponding lines.

@zakkak zakkak added this to the 23.0.3.0-Final milestone Dec 12, 2023
@zakkak zakkak force-pushed the 2023-12-12-sync-23.0 branch from f3864b7 to 7fbf185 Compare December 12, 2023 15:03
@@ -101,6 +102,6 @@ public boolean shouldEmit(long durationTicks) {

@Uninterruptible(reason = "Prevent races with VM operations that start/stop recording.", callerMustBe = true)
private boolean shouldEmit0() {
return SubstrateJVM.get().isRecording() && SubstrateJVM.get().isEnabled(this) && !SubstrateJVM.get().isCurrentThreadExcluded();
return SubstrateJVM.get().isRecording() && SubstrateJVM.get().isEnabled(this) && !JfrThreadLocal.isThreadExcluded(JavaThreads.getCurrentThreadOrNull());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roberttoyonaga can you please check if this is correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is correct. But https://github.com/graalvm/mandrel/pull/633/files/f3864b7fbb9d325ae604fdb0ffab0e71506bf636#diff-5140a589f5128cadb659640373aafca28c66b801fef8c975d65c08fb9eded219R105 !SubstrateJVM.get().isCurrentThreadExcluded(); needs to be removed because now the checking is done in JfrThreadLocal

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh it looks like you already removed it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember there was some weird quirk that may have required isThreadExcluded to be checked before isRecording and isEnabled. Let me quickly investigate to be sure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this should be correct for 23.0.

@jerboaa
Copy link
Collaborator

jerboaa commented Dec 12, 2023

The mandrel IT failure seems quarkusio/quarkus#37633

@zakkak
Copy link
Collaborator Author

zakkak commented Dec 12, 2023

The mandrel IT failure seems quarkusio/quarkus#37633

Indeed, the test no longer fails now that quarkusio/quarkus#37633 is merged, however with 23.0 we are getting:

com.oracle.svm.core.util.UserError$UserException: Incompatible change of initialization policy for io.netty.buffer.PooledByteBufAllocator: trying to change RUN_TIME from 'META-INF/native-image/io.netty/netty-buffer/native-image.properties' in 'file:///home/zakkak/code/mandrel-integration-tests/apps/jfr-native-image-performance/target/jfr-plaintext-native-image-source-jar/lib/io.netty.netty-buffer-4.1.100.Final.jar' with 'io.netty.buffer.PooledByteBufAllocator' and from feature io.quarkus.runner.Feature.beforeAnalysis with 'PooledByteBufAllocator.class' to RERUN Quarkus
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:103)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:117)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:117)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:117)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insertRec(ClassInitializationConfiguration.java:117)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationConfiguration.insert(ClassInitializationConfiguration.java:64)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.rerunInitialization(ProvenSafeClassInitializationSupport.java:162)
	at io.quarkus.runner.Feature.runtimeReinitializedClasses(Unknown Source)
	at io.quarkus.runner.Feature.beforeAnalysis(Unknown Source)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$9(NativeImageGenerator.java:757)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:89)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:757)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:582)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)

which is not the case with 23.1 and 24.0-dev (probably related to the new class initialization strategy adopted in 23.1 https://github.com/oracle/graal/blob/master/substratevm/CHANGELOG.md#graalvm-for-jdk-21-internal-version-2310)

We probably need to switch the corresponding netty classes to runtime initialize to make them compatible with 23.0. I will explore this following days.

@zakkak
Copy link
Collaborator Author

zakkak commented Dec 13, 2023

We probably need to switch the corresponding netty classes to runtime initialize to make them compatible with 23.0. I will explore this following days.

Fix in quarkusio/quarkus#37707

Copy link
Collaborator

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Tests seem alright.

@jerboaa
Copy link
Collaborator

jerboaa commented Dec 13, 2023

It would be good for @roberttoyonaga to approve the jfr changes.

Copy link
Collaborator

@roberttoyonaga roberttoyonaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good for @roberttoyonaga to approve the jfr changes.

It looks good to me. I tested it out on my machine as well. I just neglected to actually click approve.

@zakkak zakkak merged commit a55af47 into graalvm:mandrel/23.0 Dec 13, 2023
66 of 67 checks passed
@zakkak zakkak deleted the 2023-12-12-sync-23.0 branch December 13, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/JDK17 JDK17 related affects/23.0 OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[23.0] Backport: Synchronize accesses to reachability handlers