RFR: JDK-8076450 com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java: assert(!on_C_heap() || allocated_on_C_heap()) failed: growable array must be on C heap if elements are

David Holmes david.holmes at oracle.com
Wed Apr 1 11:46:24 UTC 2015


On 1/04/2015 6:46 PM, Staffan Larsen wrote:
> This is a fix for a regression caused by JDK-8074895: "os::getenv is inadequate”. That fix allocates a GrowableArray on the stack, but the elements are allocated on the C-heap. This is not allowed by GrowableArray and it asserts. The fix is to allocate the GrowableArray on the C-heap as well. Note that we do not have a resource area to allocate on this early in the startup.

<SIGH> Mea Culpa. I thought JPRT testing would exercise this change, but 
it only exercises the actual getenv call. Given the env variables are 
not set the rest of the code was completely untested.

> Also found a missing os::free() for the allocated buffer in the method.
>
> webrev: http://cr.openjdk.java.net/~sla/8076450/webrev.00/ <http://cr.openjdk.java.net/~sla/8076450/webrev.00/>
> bug: https://bugs.openjdk.java.net/browse/JDK-8076450 <https://bugs.openjdk.java.net/browse/JDK-8076450>

FWIW change looks good.

Thanks,
David

> Thanks,
> /Staffan
>


More information about the hotspot-runtime-dev mailing list