RFR: 8280289: Enhance debug pp() command with NMT info [v3]
Ioi Lam
iklam at openjdk.java.net
Mon Jan 24 06:22:07 UTC 2022
On Sun, 23 Jan 2022 00:30:23 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> Not sure about gdb, but I tried running a simple multi threaded program inside lldb on the mac. When calling a function, lldb will resume the program so other threads will execute concurrently.
>>
>> In this case, `walk_virtual_memory` is protected by a `ThreadCritical`. However, the value returned by `find_region` may become invalid as soon as `walk_virtual_memory` returns because it could be deallocated by another thread.
>
> Then malloc case is even worse, the block could be deallocated by another thread. Even `oop->print()` is questionable ...
Can the printing be done inside do_allocation_site() instead? That way we are holding the ThreadCritical that will prevent concurrent NMT record/remove operations.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7160
More information about the hotspot-dev
mailing list