8380059: [lworld] zero: java/foreign/enablenativeaccess/TestEnableNativeAccessJarManifest.java failed with SIGSEGV in InterpreterRuntime::write_flat_field#2382
Conversation
|
👋 Welcome back jsjolen! A progress list of the required criteria for merging this PR into |
|
@johan-sjolen 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 104 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@coleenp, @Arraying) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
0c21a4b to
352d15b
Compare
I'm not super familiar with the Zero internals or potential optimizations we have/could have baked in. However, we can't really yield that many field flattening benefits with just an interpreter. Perhaps we still enjoy a lower overall allocation rate when only buffering at points of field access? Would it make sense to revisit the flattening decisions when running Zero? As in, disable field flattening entirely and guard cases like these with assertions. |
|
tier1-tier5 with enable preview looks good. |
We could always set |
Arraying
left a comment
There was a problem hiding this comment.
The change looks good, thanks! Let's defer the discussion of if Zero should support flattening.
|
/integrate Thank you for the reviews, let's see what the future holds for Zero + Valhalla. |
|
@johan-sjolen |
|
/sponsor |
|
Going to push as commit 46dafa3.
Your commit was automatically rebased without conflicts. |
|
@Arraying @johan-sjolen Pushed as commit 46dafa3. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi,
The
zerointerpreter has fast paths for basic getters and setters, but these fail to take into account how flattened fields work. This causes flattened fields to be copied onto the stack directly, instead of wrapped in an oop (for getters), and flattened fields to be transformed into oops (for setters). Instead of adapting the fast paths, we bail to the slow path.To convince you, this is
getter_entry:and this is the basic bytecode dispatch (slow path):
I added a test in order to coax the getter/setter pattern optimization to run consistently and re-ran the previously disabled test along with the new one on linux-x64-zero, and they both pass. Running the new test with lworld -Xint linux-x64-zero crashes similarly to the reported bug.
Everything below this header is bonus info for the curious
We fail within
initofTestSuitewhich has a flattened field:and in
SuiteRunner.java:183we can see this:and
XmlSuitehas the following getterThis is probably triggering the buggy zero code.
Just some more discovery stuff:
Let's look at
si_addrwhich is0x0000000001000108. Alright, we're running with compressed klass pointers but withoutUseCompactObjectHeaders, so when doing thewrite_flat_fieldwe finally reachreturn CompressedKlassPointers::decode_not_null(_compressed_klass);and_compressed_klasshas offset 8. So, the actual "oop" is at0x1000100. OK, I dunno, that could be a flattened Boolean I guess?Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2382/head:pull/2382$ git checkout pull/2382Update a local copy of the PR:
$ git checkout pull/2382$ git pull https://git.openjdk.org/valhalla.git pull/2382/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2382View PR using the GUI difftool:
$ git pr show -t 2382Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2382.diff
Using Webrev
Link to Webrev Comment