RFR: 8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative ,counter

Coleen Phillimore coleen.phillimore at oracle.com
Mon Nov 10 18:26:52 UTC 2014


Yeah, that seems like an improvement.  I'll do it and send it out again.
Thanks,
Coleen

On 11/10/14, 12:35 PM, Aleksey Shipilev wrote:
> On 10.11.2014 20:21, Coleen Phillimore wrote:
>> Summary: Signed bitfield size y can only have (1 << y)-1 values.
>>
>> We were overflowing the the _pos index and reusing the 0th element in
>> the MallocSiteTable for two different stack traces which caused the
>> assert for deallocation.
>>
>> Tested with nsk.quick.testlist and jtreg runtime tests with
>> -XX:NativeMemoryTracking=detail.
>>
>> open webrev at http://cr.openjdk.java.net/~coleenp/8062870/
>> bug link https://bugs.openjdk.java.net/browse/JDK-8062870
> Looks good, but made my head hurt a little. I think it deserves a more
> bullet-proof rework, a la:
>
> #ifdef _LP64
>    #define SIZE_BITS 64
>    #define FLAGS_BITS 8
>    #define POS_BITS 16
>    #define BUCKET_BITS 40
> #else
>    #define SIZE_BITS 32
>    #define FLAGS_BITS 8
>    #define POS_BITS 8
>    #define BUCKET_BITS 16
> #endif  // _LP64
>
> #define MAX_MALLOCSITE_TABLE_SIZE ((size_t)((1 << BUCKET_BITS)-1))
> #define MAX_BUCKET_LENGTH         ((size_t)((1 << POS_BITS)-1))
>
>   class MallocHeader VALUE_OBJ_CLASS_SPEC {
>     size_t           _size      : SIZE_BITS;
>     size_t           _flags     : FLAGS_BITS;
>     size_t           _pos_idx   : POS_BITS;
>     size_t           _bucket_idx: BUCKET_BITS;
>   }
>
> ...and assert (SIZE_BITS + FLAGS_BITS + BUCKET_BITS + POS_BITS <=
> 2*BitsPerWord) somewhere?
>
> -Aleksey.
>
>



More information about the hotspot-runtime-dev mailing list