-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8290231: java/foreign/malloc/TestMixedMallocFree.java crashed in JDK19 ATR run #11417
Conversation
👋 Welcome back jvernee! A progress list of the required criteria for merging this PR into |
@JornVernee The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - I agree this test isn't useful anymore
@JornVernee This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 4 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 1722f9c.
Your commit was automatically rebased without conflicts. |
@JornVernee Pushed as commit 1722f9c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This test allocates on the native side with
malloc
, and then tries to free that memory on the Java side. The library that we look up on the Java side is either ucrtbase.dll, or msvcrt.dll as a fallback if we don't find it. The fact that we're seeing this crash likely means that the test machine doesn't have ucrtbase.dll, but it does have a newer standard runtime library other than msvcrt.dll (one of the msvcp*.dll libraries).So, what can happen is: the native code in the test ends up being linked against this newer runtime library. We allocate using the newer runtime library's
malloc
function. Look upfree
from Java, don't find ucrtbase.dll so fall back to msvcrt.dll. Callfree
from msvcrt.dll which is not the right one, and then crash due to the allocator mismatch.I think we should just remove this test. In practice, we can not guarantee that native code is linked against the same dll as the one we pick to be the default library (for instance, the native code could have been linked against an older dll, even while ucrtbase.dll is present on the system).
Trying to mach up the 2 libraries was important when we had public
allocateMemory
andfreeMemory
functions, but those were removed from the API.Using matching allocate & free pairs, which some of the other tests do, still works.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11417/head:pull/11417
$ git checkout pull/11417
Update a local copy of the PR:
$ git checkout pull/11417
$ git pull https://git.openjdk.org/jdk pull/11417/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11417
View PR using the GUI difftool:
$ git pr show -t 11417
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11417.diff