RFR: 8325095: C2: bailout message broken: ResourceArea allocated string used after free [v2]

Emanuel Peter epeter at openjdk.org
Mon Feb 19 09:36:00 UTC 2024


On Sat, 17 Feb 2024 00:55:15 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> src/hotspot/share/utilities/cHeapStringHolder.hpp line 41:
>> 
>>> 39:     _memflags(memflags), _string(nullptr) {}
>>> 40:   ~CHeapStringHolder() { clear(); };
>>> 41:   NONCOPYABLE(CHeapStringHolder);
>> 
>> I'd opt for a use-case-specific class inside compiler. It would allow you to hard-code mtCompiler, simplifying the code, and to log with UL into the compiler log when the failure reason is changed.
>> 
>> A new generic string class opens a whole can of bikeshedding worms, e.g. whether to make it mutable, how best to specify MEMFLAGS etc... I would avoid that, especially since the added value fo this helper class is slim.
>
> I agree this should be in `compiler/`

Ok, I can do that. Just wanted it to be shared code in case someone needs it in the future. But maybe that is too hard to do, due to bikeshedding... :/

Not sure I want to UL here, since I hold the string in multiple places, that would lead to multiple loggings.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17710#discussion_r1494256565


More information about the hotspot-dev mailing list