RFR: 8340401: DcmdMBeanPermissionsTest.java and SystemDumpMapTest.java fail with assert(_stack_base != nullptr) failed: Sanity check [v9]

Simon Tooke stooke at openjdk.org
Tue Dec 17 14:01:41 UTC 2024


On Sat, 14 Dec 2024 23:31:32 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.

Done.

> 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; }

Done.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21091#discussion_r1888567460
PR Review Comment: https://git.openjdk.org/jdk/pull/21091#discussion_r1888567267


More information about the hotspot-runtime-dev mailing list