RFR: 8280289: Enhance debug pp() command with NMT info [v3]

Zhengyu Gu zgu at openjdk.java.net
Sun Jan 23 00:33:00 UTC 2022


On Sat, 22 Jan 2022 19:55:23 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> It is not thread-safe. But the command is running inside debuger, I don't see there is concurrent case.
>
> 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 ...

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

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


More information about the hotspot-dev mailing list