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

ReduceAllocationMerges patch causes miscompiles #635

Closed
IThundxr opened this issue Dec 29, 2024 · 2 comments
Closed

ReduceAllocationMerges patch causes miscompiles #635

IThundxr opened this issue Dec 29, 2024 · 2 comments
Labels
bug Something isn't working Minecraft Issues relating to Minecraft

Comments

@IThundxr
Copy link

IThundxr commented Dec 29, 2024

Describe the bug
A clear and concise description of what the bug is.

Desktop (please complete the following information):

OS & version [e.g. Windows 10, 1822]:
Windows - Unknown versions

MSFT Build of OpenJDK Version:
17.0.8+7

Screenshots, Logs etc
The following gist contains multiple jvm crash logs, and multiple people who've encountered this issue have verified that adding -XX:-ReduceAllocationMerges to their jvm args does indeed fix this.
https://gist.github.com/IThundxr/508a9c4e57ef4956777ac8d69a67f525

Additional context
Providing reproduction instructions for this isn't really possible, seems to only happen on specific machines with the common denominator being that everyone is using microsoft's build of openjdk.

Although all the logs are for minecraft this issue likely occurs outside it aswell in specific situations, i'm just unable to get a small test case setup for it as i've never managed to reproduce this issue on my own machine.

ReduceAllocationMerges has been disabled in openjdk due to causing a number of issues, and it ends up resulting in miscompiles which causes the issues in the attached logs, this issue likely affects the java 21 build aswell.

I propose that ReduceAllocationMerges is disabled by default and requires explicitly opting into it.

@karianna
Copy link
Member

karianna commented Jan 1, 2025

@brianjstafford & @brunoborges - IIRC we did disable this by default in a later 17.0.x build, but checking with you to confirm.

@karianna karianna added bug Something isn't working Minecraft Issues relating to Minecraft labels Jan 1, 2025
@brianjstafford
Copy link

Hey @IThundxr - thanks for the report and the suggestion. Although this optimization was disabled by default in JDK 22, it was re-enabled by default in JDK 23 onwards. It was disabled briefly due to some bugs that were found late in the JDK 22 release period which couldn't be fixed in time. It was re-enabled because it provides some good performance benefits and it will bit-rot if it doesn't get used. There have been some bug fixes in the last few months that we are backporting to the Microsoft Build of OpenJDK for the January release. Hopefully this takes care of the issues you've reported and we'll continue to monitor for additional issues. Please continue to disable the optimization as a work around if you come across any issues after the January release, and provide us with any details you have that will allow us to investigate and fix.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Minecraft Issues relating to Minecraft
Projects
None yet
Development

No branches or pull requests

3 participants