RFR(S): 8220348: [ntintel] asserts about copying unalinged array

Doerr, Martin martin.doerr at sap.com
Mon Dec 2 15:12:58 UTC 2019


I'd like to propose a fix for an old issue on 32 bit Windows (also for an 11u backport):

Some jdk native methods use jni_SetLongArrayRegion with a stack allocated buffer.
jni_SetLongArrayRegion uses Copy::conjoint_jlongs_atomic which requires jlongs to be 8 byte aligned (asserted).
However, Windows 32 bit only uses 4 byte alignment for jlong arrays by default.
I found such issues in the following files:
I suggest to use __declspec(align(8)) there.

Please review.

I think using 8 byte alignment is not a disadvantage for 64 bit.

I guess there are still people interested in this platform with jdk14. Otherwise I could contribute it as 11u only fix.

Is there a better way to force 8 byte alignment for jlongs or jlong arrays on stack?
Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20191202/70b24a2d/attachment.html>

More information about the security-dev mailing list