8213411: JDK-8209189 incorrect for Big Endian (JVM crashes)
Erik Österlund
erik.osterlund at oracle.com
Tue Nov 6 11:06:29 UTC 2018
Hi Martin,
Thank you for the review.
On 2018-11-06 11:56, Doerr, Martin wrote:
> Hi Erik,
>
> thanks for fixing the issue so quickly. Looks good.
>
> Note that in
> if (state_unloading_cycle == CodeCache::unloading_cycle()) {
> return state_is_unloading;
> }
> you could also use "return false" which would be equivalent. Not sure what is better readable. (No need for a new webrev.)
Yeah I think what you are proposing might be easier to read, so I will
go with that when pushing.
Thanks,
/Erik
> Best regards,
> Martin
>
>
> -----Original Message-----
> From: Erik Österlund <erik.osterlund at oracle.com>
> Sent: Dienstag, 6. November 2018 11:34
> To: hotspot-dev developers <hotspot-dev at openjdk.java.net>
> Cc: Doerr, Martin <martin.doerr at sap.com>
> Subject: RFR: 8213411: JDK-8209189 incorrect for Big Endian (JVM crashes)
>
> Hi,
>
> In my patch for 8209189 I assumed that the following struct containing a
> bit field using 3 bits, would be packed to one byte:
>
> struct IsUnloadingStruct {
> unsigned int _is_unloading:1;
> unsigned int _unloading_cycle:2;
> };
>
> Turns out though that the size of this 3 bit bitfield is typically 4
> bytes, causing trouble on big endian machines. The compilers can be
> tamed to turn this to a byte (as expected) by using struct packing.
>
> So the two most obvious solutions are either
> 1) Make a struct packing macro, and trust the compilers won't mess up then.
> 2) Do manual bit fiddling because we do not trust compilers.
>
> Martin convinced me to go with #2.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8213411
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8213411/webrev.00/
>
> Running a bunch of tests while waiting for review.
>
> Thanks,
> /Erik
More information about the hotspot-dev
mailing list