mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-30 22:08:45 +00:00
OpenJDK 11 misuses the low bits in pointers that have an assumed
alignment. This is undefined behavior and compiler optimizations break
the code at runtime, causing SIGSEGV in the garbage collector.
This was originally noticed for clang13, but GCC15 seems to
do similar optimizations now. The UB was removed in JDK14.
See https://bugs.openjdk.org/browse/JDK-8229258
This is a smaller version of the unsuccessful backport PR proposed upstream:
https://github.com/openjdk/jdk11u-dev/pull/1284
Removed the .github/workflows changes and everything from the markOop to
markWord rename and file move from the patch. I found a way to avoid most
of the `markOopDesc`->`markOop` renames with a typedef, and dropped the
changes to all architectures besides x86 and aarch64.
Fixes: https://github.com/nixos/nixpkgs/issues/526834
(cherry picked from commit e09bc37026)