OpenHFT / Zero-Allocation-Hashing

Zero-allocation hashing for Java
Apache License 2.0
779 stars 136 forks source link

Possible alignment issues crashing JVM on SPARC platform #78

Open n4al opened 1 year ago

n4al commented 1 year ago

UnsafeAccess class produces SIGBUS on Solaris/SPARC and crashes the JVM. I have originally found this issue with Gatling that ships OpenHFT ZAH as part of Scala's Zinc compiler. It crashes regardless of OS and JDK version, making the platform being the only thing left. Possible issue is alignment given that SPARC and ARM processors enforce it while x86 is permissive (see, for example: https://shipilev.net/jvm/anatomy-quarks/24-object-alignment/)

To reproduce the problem:

  1. on a Solaris/SPARC platform (I can assist here if needed) clone the git repository
  2. run mvn package
  3. observe the test results: mvn-package.out.txt

I am attaching the error reports: error_report.zip

gzm55 commented 1 year ago

it seems that, on sparc we need to avoid unsafe operations at all.

n4al commented 1 year ago

Do you happen to have a suggestion for a workaround?

gzm55 commented 1 year ago

imo, the only way is that find all unsafe invocation and use java native method when on SPARC

alamar commented 1 year ago

Unfortunately, we only target x86_64 and arm architectures and do not have SPARC targets, so we are not able to test and fix this.

n4al commented 1 year ago

Would it help if I provided one?

tgd commented 2 months ago

Hi @n4al - reviewing this as its been open for some time. We do not currently support SPARC - we do support ARM and have build targets for those with tests passing. Are you able to reproduce any failures on ARM? Regarding SPARC we have no plans to support this but if you would like to expedite the development of this please get in touch with us here for commercial support: https://chronicle.software/contact-us/