UnsafeAtomicityTest crashes on SPARC

Alan Burlison Alan.Burlison at oracle.com
Wed Aug 31 12:42:39 UTC 2016


On 30/08/2016 11:38, David Holmes wrote:

>> We have removed "&& info->si_code == BUS_OBJERR" in our JVM. It should
>> also catch other types like BUS_ADRALN.
>
> I'm not yet convinced that we should be anticipating/supporting
> unaligned access from Unsafe. But I'll look into this more closely later
> this week.

Hadoop makes misaligned accesses using Unsafe all over the place.

https://issues.apache.org/jira/browse/HADOOP-12630
https://issues.apache.org/jira/browse/HADOOP-12720

That's because the relevant Hadoop code is a pile and assumes it will 
only ever run on architectures that support misaligned accesses. As it 
is using Unsafe to do so there is a case to be made that they are 
getting what they deserve, but on the other hand it means that they've 
created a Java app that will not run on all the platforms that Java 
supports.

I know Unsafe is going away, I don't know if the replacement will 
prevent or allow similar misaligned accesses.

It might be useful if there was a run-time check that you could turn on 
that checked for misaligned accesses, that way people writing such code 
would at least have some way of figuring out if they have shot 
themselves in the foot with regards to cross-platform portability.

-- 
Alan Burlison
--


More information about the hotspot-runtime-dev mailing list