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

Coleen Phillimore coleen.phillimore at oracle.com
Wed Apr 1 14:23:13 UTC 2015


Me too.  Sorry I didn't notice this in the code review.  I didn't think 
JPRT would test it but glad to see we found it in one nightly test run.
Coleen

On 4/1/15, 7:46 AM, David Holmes wrote:
> 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