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

Zhengyu Gu zgu at openjdk.java.net
Mon Sep 21 12:35:22 UTC 2020


On Mon, 21 Sep 2020 05:42:00 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

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

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

Well, without cleaning stack_base and stack_size, the thread appears to be live and running, which contradicts NMT
report (and maybe others, e.g. smap, etc.)

My initial thought is to filter out terminated thread in Threads::print_on_error(), but it does not seem to have a way.

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

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


More information about the hotspot-runtime-dev mailing list