[OpenJDK 2D-Dev] RFR 8144828: Marlin renderer causes unaligned write accesses

Laurent Bourgès bourges.laurent at gmail.com
Mon Dec 7 16:34:09 UTC 2015


Hi,

Please review the following (critical) bug fix that ensures (4 bytes)
aligned memory accesses (Unsafe) in MarlinCache:

bug: https://bugs.openjdk.java.net/browse/JDK-8144828
webrev: http://cr.openjdk.java.net/~lbourges/marlin/marlin-8144828.0/

Changes:
- added MarlinConst.doCheckUnsafe (false by default) to manually check
addresses
- MarlinCache: align needed bytes in copyAARowNoRLE() as the same off-heap
block is also used by copyAARowRLE_WithBlockFlags() which store RLE entries
as integer:

+        // determine need array size:+        // for RLE encoding,
position must be aligned to 4 bytes (int):+        // align - 1 = 3 so
add +3 and round-off by mask ~3 = -4+        final long needSize = pos
+ ((px_bbox1 - px0 + 3) & -4);

I did not tested on the sparc platform as I do not have one !
But it tested the patch on my linux 64 (intel).

Best regards,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20151207/b9b256c8/attachment.html>


More information about the 2d-dev mailing list