Skip to content

Native JFR: Hangs or segfaults intermittently on Quarkus app shutdown #5434

@Karm

Description

@Karm

Hello,
I noticed segfaults and hangs on JFR enabled Quarkus app shutdown. I am unable to reproduce it with
graalvm-ce-java17-linux-amd64-22.3.0 ✔️
while I can easily reproduce it with the contemporary dev build
23.0.0-dev-20221103_2324/graalvm-ce-java17-linux-amd64-dev ❌.
The behavior is the same with Mandrel distribution, i.e. this is not GraalVM distribution specific.

Even with +H:+DumpThreadStacksOnSignal, the app does not respond to me doing kill -3 <pid>, so I included debug symbols, as noted below, to have a meaningful threaddump via gdb. Note that the issue is reproducible without mandating debug symbols as well as without +H:+DumpThreadStacksOnSignal and without -H:-DeleteLocalSymbols.

Steps to reproduce the issue

$ git clone --branch 2.13.3.Final https://github.com/quarkusio/quarkus-quickstarts.git
$ cd quarkus-quickstarts/micrometer-quickstart/
$ export JAVA_HOME=/var/X/JDKs/graalvm-ce-java17-23.0.0-dev/;export GRAALVM_HOME=${JAVA_HOME};export PATH=${JAVA_HOME}/bin:${PATH}
$ ./mvnw clean package -Dnative -Dquarkus.native.enable-vm-inspection=true -Dquarkus.native.debug.enabled -Dquarkus.native.additional-build-args=-H:+AllowDeprecatedBuilderClassesOnImageClasspath,-H:+DumpThreadStacksOnSignal,-H:-DeleteLocalSymbols
$ ./target/micrometer-quickstart-runner -XX:+FlightRecorder -XX:StartFlightRecording="filename=recording.jfr"
$ Ctrl^C

If you repeat the last two steps, start, stop, a couple of times (3 to 7 times cca on my workstation), the process either segfaults or hangs on shutdown without writing anything to recording.jfr. It seems irrelevant if you access the micrometer metrics http://localhost:8080/q/metrics or not. In my experience a simple start-stop loop is what very easily triggers the issue.

Describe GraalVM and your environment:

  • GraalVM version: 23.0.0-dev-20221103_2324
  • JDK major version: 17
  • OS: CentOS 8 Stream
  • Architecture: amd64

FYI @roberttoyonaga

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions