RFR: 8269537: memset() is called after operator new [v2]
Kim Barrett
kbarrett at openjdk.java.net
Sun Sep 26 04:53:07 UTC 2021
On Fri, 24 Sep 2021 08:50:18 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:
>> I hit the new assert when not on Linux, I guess it has to do with the initialization of the thread local variable.
>
> Thanks Ioi for making me adding the assert!!! The sequencing of the allocation function and the arguments to the constructor is not what I thought, so my "solution" is not working. I am unsure how to resolve this in a good way. We could probably have a small thread local collection of (type, address) pairs, but I wonder if it is not better removing this debug information altogether. It is to my knowledge only used in GrowableArray (to limit the type of its internal allocations) and to hinder delete on resource allocated objects.
A collection of (type, address) pairs is still problematic. It still requires assuming that the address of the derived object is the same as the address of the ResourceObj subobject, which isn't guaranteed, though the current mechanism also depends on that being true. I think there might be other places in HotSpot where we're making that assumption too, unfortunately.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5387
More information about the serviceability-dev
mailing list