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

Staffan Larsen staffan.larsen at oracle.com
Wed Apr 1 08:46:55 UTC 2015


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.

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>

Thanks,
/Staffan


More information about the hotspot-runtime-dev mailing list