RFR(XS) 8037959: BitMap::resize frees old map before copying memory if !in_resource_area

Bengt Rutisson bengt.rutisson at oracle.com
Fri Mar 21 10:59:43 UTC 2014

Hi Mikael,

The fix looks good. Since this code path is unused it might be an idea to add a test to exercise it a bit. Is it worth the effort to do that?


> 21 mar 2014 kl. 10:39 skrev Mikael Gerdin <mikael.gerdin at oracle.com>:
> Hi all,
> While reading through the code for BitMap I stumbled across a bug in the 
> resize functionality for bitmaps not allocated in the resource area.
> The problem is that if a previous backing for the bitmap exists we free the 
> backing memory before attempting to copy its contents to the new backing 
> memory.
> I've followed the code paths leading to resize so I'm pretty sure this bug is 
> currently benign since we never actually encounter this case but it seems like 
> a good idea to fix this nevertheless.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8037959
> Webrev: http://cr.openjdk.java.net/~mgerdin/8037959/webrev.0
> /Mikael

More information about the hotspot-dev mailing list