jdk-openjdk with Generational ZGC enabled crashes #235

Open
opened 2024-02-18 12:01:38 +01:00 by AvianaCruz · 13 comments

jdk-openjdk (JDK 21) package in ALHP crashes when Generational ZGC is enabled.

For example:

$ java -XX:+UseZGC -XX:+ZGenerational
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=***, pid=***, tid=***
#
# JRE version:  (21.0.2+13) (build )
# Java VM: OpenJDK 64-Bit Server VM (21.0.2+13, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x***]  ZGeneration::ZGeneration(ZGenerationId, ZPageTable*, ZPageAllocator*)+0x***
#
`jdk-openjdk` (JDK 21) package in ALHP crashes when Generational ZGC is enabled. For example: ```console $ java -XX:+UseZGC -XX:+ZGenerational # # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=***, pid=***, tid=*** # # JRE version: (21.0.2+13) (build ) # Java VM: OpenJDK 64-Bit Server VM (21.0.2+13, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x***] ZGeneration::ZGeneration(ZGenerationId, ZPageTable*, ZPageAllocator*)+0x*** # ```
Owner

Have you confirmed this is only happening with the ALHP package, e.g. downgrading to official repos with pacman -S extra/jdk-openjdk solves this issue?

Have you confirmed this is only happening with the ALHP package, e.g. downgrading to official repos with `pacman -S extra/jdk-openjdk` solves this issue?
anonfunc added the
bug
label 2024-02-18 18:22:11 +01:00
Author

Downgrading to official build works. I have confirmed that the ALHP package of all feature levels has the issue.

Downgrading to official build works. I have confirmed that the ALHP package of all feature levels has the issue.
Owner

Does this also happen with earlier jdk/jre versions, like jdk17-openjdk or jdk11-openjdk?

Does this also happen with earlier jdk/jre versions, like `jdk17-openjdk` or `jdk11-openjdk`?

JDK is known to have issues with optimizations. Thats why e.g. -O3 is replaced with O2 in the PKGBUILD.

I dunno how other optimizations are handled though.

I'm working with Java, but not developing on the JDK itself.

JDK is known to have issues with optimizations. Thats why e.g. -O3 is replaced with O2 in the PKGBUILD. I dunno how other optimizations are handled though. I'm working with Java, but not developing on the JDK itself.
Author

@anonfunc Earlier JDK versions don't support Generational ZGC.

@anonfunc Earlier JDK versions don't support Generational ZGC.
Owner

Nvm, just saw that you meant Generational ZGC. So, not building 21 should suffice?

Nvm, just saw that you meant *Generational* ZGC. So, not building 21 should suffice?
Author

@anonfunc It would suffice. However, I have checked that just disabling LTO makes Generational ZGC work.

@anonfunc It would suffice. However, I have checked that just disabling LTO makes Generational ZGC work.
Owner

That's even better. I disabled LTO for java-openjdk. Please confirm it's actually working as soon as the rebuild is finished.

That's even better. I disabled LTO for `java-openjdk`. Please confirm it's actually working as soon as the rebuild is finished.
Author

It still does not work but the error is a little different:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=***, pid=***, tid=***
#
# JRE version:  (21.0.2+13) (build )
# Java VM: OpenJDK 64-Bit Server VM (21.0.2+13, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x***]
It still does not work but the error is a little different: ```log # A fatal error has been detected by the Java Runtime Environment: # # SIGSEGV (0xb) at pc=***, pid=***, tid=*** # # JRE version: (21.0.2+13) (build ) # Java VM: OpenJDK 64-Bit Server VM (21.0.2+13, mixed mode, sharing, tiered, compressed class ptrs, z gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x***] ```
Owner

So no-build list it is. Regrettable, but probably no way around it.

So no-build list it is. Regrettable, but probably no way around it.

It's a pity yes.

The downside is probably not that huge though. As the Java code itself are optimized at runtime for the platform its running on. So the cpu flags are already taken advantage of.

The optimization would be good for the native part of the JVM like garbage collection, runtime compiler (hotspot) and other things. Yet I can imagine that even their they try to optimize a lot.

I compared once a -march=native local build vs vanilla adoptium build and they had the same runtime of our unit tests suite of our main business application.

It's a pity yes. The downside is probably not that huge though. As the Java code itself are optimized at runtime for the platform its running on. So the cpu flags are already taken advantage of. The optimization would be good for the native part of the JVM like garbage collection, runtime compiler (hotspot) and other things. Yet I can imagine that even their they try to optimize a lot. I compared once a -march=native local build vs vanilla adoptium build and they had the same runtime of our unit tests suite of our main business application.
Owner

I added jdk-openjdk to the list, should be removed with the next build-cycle.

I added `jdk-openjdk` to the list, should be removed with the next build-cycle.
Owner

Is this still an issue?

Is this still an issue?
Sign in to join this conversation.
No description provided.