RFR: 8340401: DcmdMBeanPermissionsTest.java and SystemDumpMapTest.java fail with assert(_stack_base != nullptr) failed: Sanity check [v2]
Simon Tooke
stooke at openjdk.org
Fri Sep 20 08:09:53 UTC 2024
On Fri, 20 Sep 2024 05:37:45 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> src/hotspot/share/nmt/memMapPrinter.cpp line 176:
>>
>>> 174: // Therefore we go for the simplest way here and check for intersection between VMA and thread stack.
>>> 175: // If the stack size is zero (i.e. no stack assigned yet), then return false.
>>> 176: if (t->stack_size() == 0) return false;
>>
>> I think this should go in the iteration loop:
>>
>> for (JavaThreadIteratorWithHandle jtiwh; JavaThread* t = jtiwh.next(); ) {
>> // We can encounter new threads whose stack has not yet been initialized - so skip them
>> if (t->stack_size() == 0) continue;
>> HANDLE_THREAD(t);
>> }
>>
>> or even
>>
>> for (JavaThreadIteratorWithHandle jtiwh; JavaThread* t = jtiwh.next(); ) {
>> // We can encounter new threads whose stack has not yet been initialized - so skip them in debug to avoid assertion
>> DEBUG_ONLY(if (t->stack_size() == 0) continue;)
>> HANDLE_THREAD(t);
>> }
>>
>> this assumes `range_intersects` will correctly handle a zero base and end in a release build.
>
> I would prefer it here, or in HANDLE_THREAD macro, to make sure we do this for all threads printed.
I will put it in HANDLE_THREAD to cover the other tests.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21091#discussion_r1768172985
More information about the hotspot-runtime-dev
mailing list