-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8335237: ubsan: vtableStubs.hpp is_vtable_stub exclude from ubsan checks #19925
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
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 25 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
|
|
I'd like to have a comment explaining it if we decide to do it this way. |
Should I just point to the other bug JDK-8331725 in the comment? |
|
Maybe: |
|
Thanks, I added a comment following your suggestions. |
|
It is only harmless from the point of view that we cannot regardless of hash generated find an entry which have its entrypoint at the location we are checking if it is not a vtable_stub. However we have no guarantees what the compiler might do in the presence of UB. So far it has not been a problem. JDK-8331725 has not been a priority for me. But I can get my fix out in a couple of days. The issue with fixing this is that C++ does not define an object representation for I suspect we have assumptions elsewhere in the code base that |
|
Thanks for the reviews ! /integrate |
|
Going to push as commit 486aa11.
Your commit was automatically rebased without conflicts. |
JDK-8331725 shows an ubsan (undefined behavior) issue in vtableStubs.hpp is_vtable_stub() .
/open_jdk/jdk_test/jdk/src/hotspot/share/code/vtableStubs.hpp:176:60: runtime error: load of value 204, which is not a valid value for type 'bool'
#0 0x110a6ad7e in VtableStubs::entry_point(unsigned char*) vtableStubs.cpp:280
#1 0x10f4cc8e6 in CompiledIC::is_megamorphic() const compiledIC.cpp:293
#2 0x10f4cc95d in CompiledIC::update(CallInfo*, Klass*) compiledIC.cpp:268
#3 0x110592eed in SharedRuntime::resolve_helper(bool, bool, JavaThread*) sharedRuntime.cpp:1366
#4 0x11058c0b3 in SharedRuntime::resolve_virtual_call_C(JavaThread*) sharedRuntime.cpp:1514
#5 0x12cd2e55a ()
#6 0x12580e03b ()
#7 0x12cc1f321 ()
#8 0x12cc1f321 ()
From the comments of the issue it seems while the coding could be improved, the problem is not very severe ('The reason bad bool values are seen is because there is no VtableStub object at that location. The reason this works is that we use the data at this location to generate a hash code, do a hash table lookup and then check the actual address for equality. Generating a bogus hash is harmless, ... ')
so as long as nothing better was found, we can exclude the method from ubsan checking.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19925/head:pull/19925$ git checkout pull/19925Update a local copy of the PR:
$ git checkout pull/19925$ git pull https://git.openjdk.org/jdk.git pull/19925/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 19925View PR using the GUI difftool:
$ git pr show -t 19925Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19925.diff
Webrev
Link to Webrev Comment