-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8333354: ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap' #20296
Conversation
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
@MBaesken 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 66 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
Hi Matthias, I think this is intended. No instances of SmallRegisterMap are ever created. Instead SmallRegisterMap::instance is used: static constexpr SmallRegisterMap* instance = nullptr; The type is the only information that is actually used. I guess you could fix the undefined behavior by replacing all uses of SmallRegisterMap::instance with the address of a stack allocated temporary SmallRegisterMap(). |
On the other hand for SmallRegisterMap in_cont returns always false (so we could at least avoid this |
When using the /jdk/src/hotspot/share/runtime/stackChunkFrameStream.inline.hpp:286:46: runtime error: member call on null pointer of type 'const struct SmallRegisterMap' this time it is the map->location call through a nullptr
But SmallRegisterMap::location is for some platforms even UnImplemented so how does this work cross platform ?
|
Continuations (-XX:+VMContinuations) haven't been ported to Arm32. |
Being intentional doesn't make it any less invalid. |
Here's an untested change that I think will fix the problem. |
Seems this works well, at least :tier1 tests on some platforms (x86_64, ppc64le) look okay to me. |
Good additional news - the jdk :tier1 tests on linux x86_64 with ubsan - enabled binaries are after this fix almost clean,
|
Any comments on the change ? |
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.
The change looks good to me.
Thanks, Richard.
I think you should add Kim as contributor (see here). |
/contributor add kimbarrett |
@MBaesken Syntax:
User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address. |
Makes sense, hope we find another second reviewer (guess as contributor, Kim cannot review) . |
/contributor add kbarrett |
@MBaesken |
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.
It's annoying that we have all these very similar platform-specific classes of
non-trivial size. It seems like it ought to be possible to refactor to reduce the
duplication. But it might not be worth the trouble, and certainly not as part of
this change.
The additions @MBaesken has made to my prototype look good to me.
Looks good except missing some copyright updates.
I think when incorporating something like my suggested changes, the PR author
can be considered to have reviewed them. The goal is to have some number of
people look over the code and approve all the pieces (an author and 2 reviewers).
At least, that's my recollection of some prior discussions of situations like this.
But I agree it can feel a little incestuous having 2 authors who are playing a
reviewer roll for the other's work, and especially when there's some back and
forth on it.
I did some asking around about this, and it seems my old info is stale and we should usually have reviewers who are |
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.
LGTM
Thanks for the reviews ! /integrate |
Going to push as commit 8162832.
Your commit was automatically rebased without conflicts. |
When running with ubsan - enabled binaries, some tests trigger the following report :
src/hotspot/share/runtime/frame.inline.hpp:91:25: runtime error: member call on null pointer of type 'const struct SmallRegisterMap'
#0 0x7fc1df86071e in unsigned char* frame::oopmapreg_to_location(VMRegImpl*, SmallRegisterMap const*) const src/hotspot/share/runtime/frame.inline.hpp:91
#1 0x7fc1df86071e in void OopMapDo<OopClosure, DerivedOopClosure, IncludeAllValues>::iterate_oops_do(frame const*, SmallRegisterMap const*, ImmutableOopMap const*) src/hotspot/share/compiler/oopMap.inline.hpp:106
#2 0x7fc1df8611df in void OopMapDo<OopClosure, DerivedOopClosure, IncludeAllValues>::oops_do(frame const*, SmallRegisterMap const*, ImmutableOopMap const*) src/hotspot/share/compiler/oopMap.inline.hpp:157
#3 0x7fc1df8611df in FrameOopIterator::oops_do(OopClosure*) src/hotspot/share/oops/stackChunkOop.cpp:63
#4 0x7fc1dcfc8745 in BarrierSetStackChunk::encode_gc_mode(stackChunkOopDesc*, OopIterator*) src/hotspot/share/gc/shared/barrierSetStackChunk.cpp:85
#5 0x7fc1df854080 in bool TransformStackChunkClosure::do_frame<(ChunkFrames)0, SmallRegisterMap>(StackChunkFrameStream<(ChunkFrames)0> const&, SmallRegisterMap const*) src/hotspot/share/oops/stackChunkOop.cpp:319
#6 0x7fc1df854080 in void stackChunkOopDesc::iterate_stack<(ChunkFrames)0, TransformStackChunkClosure>(TransformStackChunkClosure*) src/hotspot/share/oops/stackChunkOop.inline.hpp:233
#7 0x7fc1df82f184 in void stackChunkOopDesc::iterate_stack(TransformStackChunkClosure*) src/hotspot/share/oops/stackChunkOop.inline.hpp:199
Seems in case of (at least) class SmallRegisterMap we miss handling nullptr .
Progress
Issue
Reviewers
Contributors
<kbarrett@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20296/head:pull/20296
$ git checkout pull/20296
Update a local copy of the PR:
$ git checkout pull/20296
$ git pull https://git.openjdk.org/jdk.git pull/20296/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20296
View PR using the GUI difftool:
$ git pr show -t 20296
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20296.diff
Webrev
Link to Webrev Comment