RFR(S): 7178846: IterateThroughHeap: heap_iteration_callback passes a negative size for big array

Rickard Bäckman rickard.backman at oracle.com
Mon Jun 25 05:29:04 PDT 2012


Staffan,

the change looks good.

/R

On 06/25/2012 10:05 AM, Staffan Larsen wrote:
> Please review the following fix.
>
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7178846
> Webrev: http://cr.openjdk.java.net/~sla/7178846/webrev.01/
>
> Class CallbackWrapper in jvmtiTagMap.cpp has a missing cast which leads to an integer overflow.
>
> The code in question is
>      _obj_size = _o->size() * wordSize;
>
> _obj_size is a jlong
> _o->size() is an int
> wordSize is an int
>
> Changing to:
>      _obj_size = (jlong)_o->size() * wordSize;
>
> fixes the overflow.
>
> Thanks,
> /Staffan



More information about the serviceability-dev mailing list