RFR [XS] : 8219112: name_and_sig_as_C_string usages in frame_s390 miss ResourceMark
Doerr, Martin
martin.doerr at sap.com
Mon Feb 18 14:52:21 UTC 2019
Hi Matthias,
we would get "fatal error: memory leak: allocating without ResourceMark" in the debug build if there was no ResourceMark at all on the stack. However, the existing one may be at a bad position where its scope never gets left and the resources never get freed. This situation can't get detected automatically.
In the example below (nativeInst_ppc.cpp), I think we should add one. At least, I couldn't find one at a good place.
Yes, the current process is error prone. ResourceMarks can also easily get placed at wrong positions leading to "assert... re-allocated with a different ResourceMark".
Best regards,
Martin
-----Original Message-----
From: hotspot-dev <hotspot-dev-bounces at openjdk.java.net> On Behalf Of Baesken, Matthias
Sent: Montag, 18. Februar 2019 14:40
To: Aleksey Shipilev <shade at redhat.com>; 'hotspot-dev at openjdk.java.net' <hotspot-dev at openjdk.java.net>
Subject: RE: RFR [XS] : 8219112: name_and_sig_as_C_string usages in frame_s390 miss ResourceMark
Hi Aleksey and Lutz , thanks for the reviews.
One (maybe stupid) general question - is there an easy way to find out all locations of missing ResourceMark usages ?
Currently it looks to me like a very error prone process .
The name_and_sig_as_C_string() issue in this CR seems to be an easy and simple case .
But in other cases it is (for me at least) not so easy to say - is the ResourceMark missing or is it somewhere located in the calling functions ?
One example :
src/hotspot/cpu/ppc/nativeInst_ppc.cpp
363 void NativeGeneralJump::insert_unconditional(address code_pos, address entry) {
364 CodeBuffer cb(code_pos, BytesPerInstWord + 1);
365 MacroAssembler* a = new MacroAssembler(&cb);
366 a->b(entry);
367 ICache::ppc64_flush_icache_bytes(code_pos, NativeGeneralJump::instruction_size);
368 }
Do we need the ResouceMark here or not ?
Best regards, Matthias
> -----Original Message-----
> From: Aleksey Shipilev <shade at redhat.com>
> Sent: Montag, 18. Februar 2019 12:55
> To: Baesken, Matthias <matthias.baesken at sap.com>; 'hotspot-
> dev at openjdk.java.net' <hotspot-dev at openjdk.java.net>
> Subject: Re: RFR [XS] : 8219112: name_and_sig_as_C_string usages in
> frame_s390 miss ResourceMark
>
> On 2/18/19 9:47 AM, Baesken, Matthias wrote:
> > Bug/webrev :
> > http://cr.openjdk.java.net/~mbaesken/webrevs/8219112.0/
>
> Looks good and trivial.
>
> -Aleksey
More information about the hotspot-dev
mailing list