Commit Graph

2 Commits

Author SHA1 Message Date
Stefan Nürnberger
e09bc37026 openjdk11{, -headless}: fix UB in markOop
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
2026-06-22 19:05:28 +02:00
Emily
9bad08529e openjdk{8,11,17,21,23}: deduplicate into generic.nix 2024-10-24 15:04:55 +01:00