RFR(XS): 8098517: Unprotected PrintMalloc in os::realloc

David Holmes david.holmes at oracle.com
Mon Jun 15 11:46:56 UTC 2015


On 15/06/2015 8:44 PM, Vitaly Davidovich wrote:
> Hi Kim,
>
> Would it make sense to guard the other couple of tty uses in this method
> as well? Similar to os::free there.

The "unguarded" ones are all "guarded" by conditions of the form:

if ((intptr_t)ptr == (intptr_t)MallocCatchPtr) {

and would only trigger upon memory corruption, and then only have an 
issue with a null tty if the corruption is very early in the 
initialization sequence - which seems a very low likelihood and one for 
which a SEGV would not be that bad a thing. Whereas the PrintMalloc uses 
are unconditional and probably do happen before tty has been initialized.

So adding the NULL check would be harmless but also not particularly 
useful, in my opinion.

Cheers,
David

> sent from my phone
>
> On Jun 15, 2015 1:47 AM, "Kim Barrett" <kim.barrett at oracle.com
> <mailto:kim.barrett at oracle.com>> wrote:
>
>     On Jun 14, 2015, at 10:41 PM, David Holmes <david.holmes at oracle.com
>     <mailto:david.holmes at oracle.com>> wrote:
>      >
>      > Looks good and trivial - feel free to push.
>
>     Thanks.
>


More information about the hotspot-runtime-dev mailing list