-
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
8332699: ubsan: jfrEventSetting.inline.hpp:31:43: runtime error: index 163 out of bounds for type 'jfrNativeEventSetting [162]' #19628
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 29 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 |
/label jfr |
@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.
LGTM
/label hotspot-jfr |
@RealCLanger |
Good catch! But I am not sure the solution is correct, or not enough. On my machine (linux x64), I see 169 explicitly named events in So, there is a mismatch somewhere between If you have figured this out, and fixed it, could you please let the generator add a
to the header? |
My maximum JfrEventId is 163 , see the generated hotspot/variant-server/gensrc/jfrfiles/jfrEventIds.hpp
so NUMBER_OF_EVENTS + NUMBER_OF_RESERVED_EVENTS looks fine to me. |
No, I am quite sure the But it's an issue orthogonal to the one you are fixing. I opened https://bugs.openjdk.org/browse/JDK-8334031 to track it. |
About your fix, do you know why MetadataEvent and CheckPointEvent would not count toward the number of events? In other words, why NUMBER_OF_EVENTS is 162 if we have 164 events? Maybe the number of events is wrong? @egahlin ? |
The metadata and check point events are built-in and hold labels/descriptions and constants, so they can't be enabled/disabled and thus don't need event settings. |
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.
@egahlin thank you. Patch is okay then.
Hi Thomas and Johannes, thanks for the reviews ! /integrate |
Going to push as commit abbf45b.
Your commit was automatically rebased without conflicts. |
When running hs :tier1 tests or jdk/jfr tests, with ubsan enabled (configure flag --enable-ubsan), in a lot of jfr related tests like
compiler/intrinsics/klass/CastNullCheckDroppingsTest.jtr
serviceability/jvmti/RedefineClasses/RedefineSharedClassJFR.jtr
this oob error can be seen :
/jdk/src/hotspot/share/jfr/recorder/jfrEventSetting.inline.hpp:31:43: runtime error: index 163 out of bounds for type 'jfrNativeEventSetting [162]'
#0 0x7f6b75a8634b in JfrEventSetting::setting(JfrEventId) /jdk/src/hotspot/share/jfr/recorder/jfrEventSetting.inline.hpp:31
#1 0x7f6b75a8634b in JfrEventSetting::set_stacktrace(long, bool) /jdk/src/hotspot/share/jfr/recorder/jfrEventSetting.cpp:47
Looks like the array in generated code is too small.
With
jfrNativeEventSetting bits[NUMBER_OF_EVENTS];
and
Access at index 163 cannot work.
But it looks like there is always enough memory after the array so we do not crash and it was not noticed before.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19628/head:pull/19628
$ git checkout pull/19628
Update a local copy of the PR:
$ git checkout pull/19628
$ git pull https://git.openjdk.org/jdk.git pull/19628/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19628
View PR using the GUI difftool:
$ git pr show -t 19628
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19628.diff
Webrev
Link to Webrev Comment