RFR: 8310275: Bug in assignment operator of ReservedMemoryRegion [v2]

Thomas Stuefe stuefe at openjdk.org
Wed Jul 26 08:42:52 UTC 2023


On Wed, 26 Jul 2023 08:27:55 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

> > Sorry but how can a thread not detaching before exiting cause our buggy RMR assignment operator to be called??
> 
> In the VirtualMemoryTracker::add_reserved_region() method we detect that a newly registered reserved region if overlapping with an already existing reserved region. If that already existing region has type mtThreadStack we assume that the thread ended without notifying the virtual memory tracker and fix this by assigning the new reserved region to the old one. And that is where the assignment operator is called (see
> 
> https://github.com/openjdk/jdk/blob/e9daf4a0185b90762d2bdd38d86fe93b4822ea08/src/hotspot/share/services/virtualMemoryTracker.cpp#L373
> ).

And libc's typically cache and reuse thread stacks, so this error is not unlikely.

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

PR Comment: https://git.openjdk.org/jdk/pull/14440#issuecomment-1651238140


More information about the hotspot-runtime-dev mailing list