Repost: RFR (S) JDK-6311046: -Xcheck:jni should support checking of GetPrimitiveArrayCritical
Daniel D. Daugherty
daniel.daugherty at oracle.com
Thu Jun 5 17:43:11 UTC 2014
On 6/5/14 9:56 AM, Zhengyu Gu wrote:
> src/share/vm/runtime/os.cpp
>> old line 743: if (memblock == NULL) {
>> old line 744: return malloc(size, memflags, (caller == 0 ?
>> CALLER_PC : caller));
>> new line 643: if (memblock == NULL) {
>> new line 644: return os::malloc(size, memflags, (caller == 0 ?
>> CALLER_PC : caller));
>> Looks like a case where NMT tracking was missing an
>> allocation in non-ASSERT bits if os::realloc() was called
>> with a NULL memblock parameter.
>>
>> Nice catch!
>>
>> old line 754: void* ptr = malloc(size, memflags, caller == 0 ?
>> CALLER_PC : caller);
>> new line 656: void* ptr = os::malloc(size, memflags, caller == 0
>> ? CALLER_PC : caller);
>> old line 764: free(memblock);
>> new line 669: os::free(memblock);
>> And again. You should run these by Zhengyu so he can
>> sanity check that this wasn't intentional and make sure
>> that NMT2 has the same fix.
>>
> It is not a problem, just not as clear as new ones. This part of code
> is in os::realloc(), where os::malloc() takes precedence over
> ::malloc(), besides ::malloc() does not have compatible function
> signature.
Thanks for clearing up my mistaken mumbling about which
malloc() was being called. Not enough coffee on board
when I wrote that review comment... :-)
Dan
>
>
> -Zhengyu.
More information about the hotspot-runtime-dev
mailing list