8384202: [lworld] C2: assert(offset == field->offset_in_bytes()) failed: offset mismatch#2433
8384202: [lworld] C2: assert(offset == field->offset_in_bytes()) failed: offset mismatch#2433TobiHartmann wants to merge 3 commits into
Conversation
|
👋 Welcome back thartmann! A progress list of the required criteria for merging this PR into |
|
@TobiHartmann 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 3 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 |
Webrevs
|
| @@ -230,7 +230,9 @@ Node* InlineTypeNode::field_value_by_offset(int offset, bool recursive) const { | |||
| assert(!field->is_flat() || field->type()->is_inlinetype(), "must be an inline type"); | |||
|
|
|||
| if (!recursive || !field->is_flat() || value->is_top()) { | |||
There was a problem hiding this comment.
This looks a bit cluttered, can we move if (value->is_top()) into a separate case before this if instead?
There was a problem hiding this comment.
Sure. I had this version first and didn't like it but I don't have a strong opinion. Updated.
marc-chevalier
left a comment
There was a problem hiding this comment.
That makes sense. Do we want the bug number in the test?
| * @modules java.base/jdk.internal.vm.annotation | ||
| * @run main ${test.main.class} | ||
| * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions | ||
| * -XX:+StressIGVN -XX:StressSeed=8 -XX:+AlwaysIncrementalInline |
There was a problem hiding this comment.
The hardcoded is on purpose? It reproduces so rarely otherwise?
There was a problem hiding this comment.
Yes, it's on purpose to make it reliably reproduce the issue and the usual way of how we design these tests. I.e. one run with fixed seed and one without. As we discussed offline, there are several alternatives to this approach, including RepeatCompilation etc. We decided on the current approach a while ago but we can surely revisit. It's out of scope of this PR though 🙂
Testing also revealed that PreloadClasses is required to make sure that the @NullRestricted annotation is respected, so I added a corresponding @requires.
There was a problem hiding this comment.
I think that means this test lacks a test that does not use a fixed seed?
|
Thanks for the reviews Quan Anh and Marc! I pushed an updated version.
I added a bug number to the test. |
merykitty
left a comment
There was a problem hiding this comment.
Thanks, that looks good to me.
The original failure was in
test21fromcompiler/valhalla/inlinetypes/TestNullableInlineTypes.java#id5. I extracted it into a standalone reproducer.C2 asserts in
InlineTypeNode::field_value_by_offsetwhile looking up a field value by offset. The lookup reaches a flat field whose corresponding input is alreadyTOP. This happens on the normal return path fromtest2()intest(). That path is dead becausetest2()always throws aNullPointerExceptionwhen it tries to initialize a null restricted field with null. We only "know" this after incremental inlining though.So at this point, with
-XX:+StressIGVN, the impossible control path has not been removed yet, but the data path has already started dying: field values on the deadInlineTypeNodehave been replaced byTOP.InlineTypeNode::field_value_by_offsetalready accounts for this with avalue->is_top()check, but the offset assert in that case is too strict.In this reproducer, the lookup is recursive: it asks for a field inside a flat field whose value is already
TOP. Therefore, the requested offset is the offset of a nested field within the flattened payload, whilefield->offset_in_bytes()is the offset of the enclosing flat field. Those offsets are not expected to match.I adjusted the assert accordingly.
Thanks,
Tobias
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2433/head:pull/2433$ git checkout pull/2433Update a local copy of the PR:
$ git checkout pull/2433$ git pull https://git.openjdk.org/valhalla.git pull/2433/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2433View PR using the GUI difftool:
$ git pr show -t 2433Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2433.diff
Using Webrev
Link to Webrev Comment