Skip to content

Conversation

@dmlloyd
Copy link
Collaborator

@dmlloyd dmlloyd commented Oct 24, 2025

The HotSpot JVM appears to miscompile the intrinsic for unsigned integer comparision in certain compilation tiers. We can avoid it by manually inlining the comparison.

Credit to @chirino and @andreaTP for chasing this down with some novel detective work.

Fixes #843

The HotSpot JVM appears to miscompile the intrinsic for unsigned integer comparision in certain compilation tiers.
We can avoid it by manually inlining the comparison.

Credit to @chirino and @andreaTP for chasing this down with some novel detective work.

Fixes dylibso#843

public static boolean shouldUseMemWorkaround() {
return shouldUseMemWorkaround(System.getProperty("java.version"));
return false;
Copy link
Collaborator

@andreaTP andreaTP Oct 24, 2025

Choose a reason for hiding this comment

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

I'm ok with this, should we deprecate this class entirely so that it can be removed in the next major release?

Copy link
Collaborator

@andreaTP andreaTP left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot for getting to the bottom of this @dmlloyd 🎉 🙏

@dmlloyd
Copy link
Collaborator Author

dmlloyd commented Oct 24, 2025

Surprise! It's failing! Interesting that the fix worked locally though 🤔

@dmlloyd
Copy link
Collaborator Author

dmlloyd commented Oct 24, 2025

It looks like the intrinsic thing was another red herring that affected C2 in an oblique way. So, back to the drawing board!

@dmlloyd dmlloyd closed this Oct 24, 2025
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 this pull request may close these issues.

JVM issue with memoryCopy

2 participants