RFR: 8340401: DcmdMBeanPermissionsTest.java and SystemDumpMapTest.java fail with assert(_stack_base != nullptr) failed: Sanity check [v9]
David Holmes
dholmes at openjdk.org
Sat Dec 14 23:34:40 UTC 2024
On Fri, 13 Dec 2024 16:35:54 GMT, Simon Tooke <stooke at openjdk.org> wrote:
>> This PR addresses JDK-8340401 by adding a test for a thread with no stack currently assigned.
>
> Simon Tooke has updated the pull request incrementally with one additional commit since the last revision:
>
> implement and use new Thread::stack_base_or_null() method
src/hotspot/share/nmt/memMapPrinter.cpp line 175:
> 173: // kernel. That can happen, e.g., for non-java threads that don't have guard pages.
> 174: // Therefore we go for the simplest way here and check for intersection between VMA and thread stack.
> 175: return range_intersects(from, to, (const void*)t->stack_end(), (const void*)t->stack_base_or_null());
Possibly add a comment:
// Note it is possible to encounter a brand new thread that has not yet initialized its stack fields.
src/hotspot/share/runtime/thread.hpp line 528:
> 526: // Stack overflow support
> 527: address stack_base() const DEBUG_ONLY(;) NOT_DEBUG({ return _stack_base; })
> 528: address stack_base_or_null() const { return _stack_base; }
Suggestion:
// Needed for code that can query a new thread before the stack has been set.
address stack_base_or_null() const { return _stack_base; }
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21091#discussion_r1885424091
PR Review Comment: https://git.openjdk.org/jdk/pull/21091#discussion_r1885423635
More information about the hotspot-runtime-dev
mailing list