Skip to content

Conversation

@MBaesken
Copy link
Member

@MBaesken MBaesken commented May 27, 2024

When running jtreg HS :tier1 tests (with ubsan enabled binaries) this error can be seen on Linux ppc64.
Probably we should add a NULL check because calling into a nullptr is probably not a good idea (although no crash is observed).

runtime/os/TestHugePageDecisionsAtVMStartup_THP_enabled.jtr

/jdk/src/hotspot/share/memory/metaspace/runningCounters.cpp:48:61: runtime error: member call on null pointer of type 'struct VirtualSpaceList'
#0 0x7fffabe667c8 in metaspace::RunningCounters::reserved_words_nonclass() (/images/jdk/lib/server/libjvm.so+0x78667c8)
#1 0x7fffab6a25c0 in MetaspaceUtils::get_statistics(Metaspace::MetadataType) (/images/jdk/lib/server/libjvm.so+0x70a25c0)
#2 0x7fffab6a2708 in MetaspaceUtils::get_combined_statistics() (/images/jdk/lib/server/libjvm.so+0x70a2708)
#3 0x7fffab5ce630 in MemBaseline::baseline(bool) (/images/jdk/lib/server/libjvm.so+0x6fce630)
#4 0x7fffab61bf10 in MemTracker::report(bool, outputStream*, unsigned long) (/images/jdk/lib/server/libjvm.so+0x701bf10)
#5 0x7fffab61cb84 in MemTracker::error_report(outputStream*) (/images/jdk/lib/server/libjvm.so+0x701cb84)
#6 0x7fffac93f1e8 in VMError::report(outputStream*, bool) (/images/jdk/lib/server/libjvm.so+0x833f1e8)
#7 0x7fffac944630 in VMError::report_and_die(int, char const*, char const*, char*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long) (/images/jdk/lib/server/libjvm.so+0x8344630)
#8 0x7fffa9d69ffc in report_fatal(VMErrorType, char const*, int, char const*, ...) (/images/jdk/lib/server/libjvm.so+0x5769ffc)
#9 0x7fffaadff93c in TypedFlagAccessImpl<unsigned int, EventUnsignedIntFlagChanged>::check_constraint_and_set(JVMFlag*, void*, JVMFlagOrigin, bool) const [clone .part.0] (/images/jdk/lib/server/libjvm.so+0x67ff93c)
#10 0x7fffaae12bb8 in RangedFlagAccessImpl<unsigned long, EventUnsignedLongFlagChanged>::set_impl(JVMFlag*, void*, JVMFlagOrigin) const (/images/jdk/lib/server/libjvm.so+0x6812bb8)
#11 0x7fffaae04b8c in JVMFlagAccess::set_or_assert(JVMFlagsEnum, int, void*, JVMFlagOrigin) (/images/jdk/lib/server/libjvm.so+0x6804b8c)
#12 0x7fffa9a79fa8 in CodeCache::initialize_heaps() (/images/jdk/lib/server/libjvm.so+0x5479fa8)
#13 0x7fffa9a7ac10 in CodeCache::initialize() (/images/jdk/lib/server/libjvm.so+0x547ac10)
#14 0x7fffaa81af08 in init_globals() (/images/jdk/lib/server/libjvm.so+0x621af08)
#15 0x7fffac68baa8 in Threads::create_vm(JavaVMInitArgs*, bool*) (/images/jdk/lib/server/libjvm.so+0x808baa8)
#16 0x7fffaaca20b4 in JNI_CreateJavaVM (/images/jdk/lib/server/libjvm.so+0x66a20b4)
#17 0x7fffb17b3068 in InitializeJVM /jdk/src/java.base/share/native/libjli/java.c:1550
#18 0x7fffb17b3068 in JavaMain /jdk/src/java.base/share/native/libjli/java.c:491
#19 0x7fffb17bef1c in ThreadJavaMain /jdk/src/java.base/unix/native/libjli/java_md.c:642
#20 0x7fffb16d9714 in start_thread (/lib64/libpthread.so.0+0x9714)
#21 0x7fffb0a8b774 in __GI___clone (/lib64/libc.so.6+0x13b774)


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8332955: ubsan: runningCounters.cpp:48:61: runtime error: member call on null pointer of type 'struct VirtualSpaceList' (Bug - P4) ⚠️ Issue is not open.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/19412/head:pull/19412
$ git checkout pull/19412

Update a local copy of the PR:
$ git checkout pull/19412
$ git pull https://git.openjdk.org/jdk.git pull/19412/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19412

View PR using the GUI difftool:
$ git pr show -t 19412

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/19412.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 27, 2024

👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented May 27, 2024

@MBaesken This change is no longer ready for integration - check the PR body for details.

@openjdk openjdk bot changed the title JDK-8332955: ubsan: runningCounters.cpp:48:61: runtime error: member call on null pointer of type 'struct VirtualSpaceList' 8332955: ubsan: runningCounters.cpp:48:61: runtime error: member call on null pointer of type 'struct VirtualSpaceList' May 27, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label May 27, 2024
@openjdk
Copy link

openjdk bot commented May 27, 2024

@MBaesken The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label May 27, 2024
@mlbridge
Copy link

mlbridge bot commented May 27, 2024

Webrevs

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with this code, but if reserved_words_nonclass() happens to be called before the VirtualSpaceList is initialized, I think this fix is good. Should be reviewed by a metaspace expert.
/reviewers 2

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 27, 2024
@openjdk
Copy link

openjdk bot commented May 27, 2024

@TheRealMDoerr
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 27, 2024
@MBaesken
Copy link
Member Author

I'm not very familiar with this code, but if reserved_words_nonclass() happens to be called before the VirtualSpaceList is initialized, I think this fix is good.

Thanks for the review !
I don't think that ubsan is 'lying' to us here, so far at least the findings were all correct. From the backtrace above you can see that this happens rather early in the JVM lifetime, this might be the reason why we run into a nullptr.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this problem was discovered when following a crash path during VM init, it makes me wonder what other code in this class we may try to use during error reporting that may not yet be initialized?

@openjdk
Copy link

openjdk bot commented Jun 6, 2024

@MBaesken this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8332955
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch and removed rfr Pull request is ready for review labels Jun 6, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 4, 2024

@MBaesken This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 1, 2024

@MBaesken This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Aug 1, 2024
@MBaesken MBaesken deleted the JDK-8332955 branch August 2, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org merge-conflict Pull request has merge conflict with target branch

Development

Successfully merging this pull request may close these issues.

3 participants