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

David Holmes david.holmes at oracle.com
Wed Jun 17 04:31:06 UTC 2015


Thunderbird seems to have lost my response to this while working offline 
yesterday :(

On 15/06/2015 10:01 PM, Vitaly Davidovich wrote:
> Understood, although having os::free do tty NULL checks for
> MallocCatchPtr is confusing then.

Yes sorry I missed that inconsistency in os::free.

> Also, not sure a SEGV on printing is
> the best way to trap that - why not crash intentionally then or print to
> stderr? But perhaps that's a separate issue.

The likelihood of encountering memory corruption prior to tty being 
initialized is negligible.

David

>
> sent from my phone
>
> On Jun 15, 2015 7:47 AM, "David Holmes" <david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>> wrote:
>
>     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>
>         <mailto: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>
>              <mailto: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