RFR: 8252921: NMT overwrite memory type for region assert when building dynamic archive [v5]

Calvin Cheung ccheung at openjdk.java.net
Mon Sep 21 05:44:54 UTC 2020


On Mon, 21 Sep 2020 05:34:52 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/runtime/thread.cpp line 1341:
>> 
>>> 1339:   unregister_thread_stack_with_NMT();
>>> 1340:   set_stack_base(NULL);
>>> 1341:   set_stack_size(0);
>> 
>> Sorry but I just don't see any need for clearing stack_base or stack_size, and then you don't need to mess with the
>> assertion in stack_base().
>
> I agree with David that the calls to `set_stack_base(NULL); set_stack_size(0);` do not seem to be related to this bug.
> Also, previously only `set_stack_base(NULL);` was called -- on all Threads. Now:
> - NonJavaThread: `set_stack_base(NULL); set_stack_size(0);`
> - JavaThread: neither operation is done
> 
> I am wondering:
> 
> - why the behavior is changed
> - is zeroing the stack_base/size necessary for NMT code only, or is it necessary for non-NMT operations as well?
> 
> Will any test cases fail if you remove line 1340/1341?

I've tried without clearing stack_base and stack_size and also reverted the change in stack_base() in thread.hpp.
It passed tier1 testing. I'll run more test.

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

PR: https://git.openjdk.java.net/jdk/pull/185


More information about the hotspot-runtime-dev mailing list