Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Native Image] JFR: Exception occurred during execution of flush task #10742

Open
2 tasks done
dekelpilli opened this issue Feb 24, 2025 · 1 comment
Open
2 tasks done
Assignees

Comments

@dekelpilli
Copy link

dekelpilli commented Feb 24, 2025

Describe the Issue

I was trying to use JFR to help debug an issue I was having, but the recording would remain empty, with the following log line appearing over and over again while the app was running:

[warn][jfr,system ] Exception occurred during execution of flush task

I've set up this repo to reproduce this issue - https://github.com/dekelpilli/graalvm-jfr-bug. It's worth noting that in its current state, the error does not always appear, but re-compiling will often make it appear again.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

java version "23.0.1" 2024-10-15
Java(TM) SE Runtime Environment Oracle GraalVM 23.0.1+11.1 (build 23.0.1+11-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 23.0.1+11.1 (build 23.0.1+11-jvmci-b01, mixed mode, sharing)

Also, as this is using clojure:

$ clojure --version
Clojure CLI version 1.12.0.1517

Operating System and Version

Darwin Mac 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6031 arm64

Troubleshooting Confirmation

Run Command

./target/graal-memory-test -XX:StartFlightRecording=filename=recording.jfr

Expected Behavior

recording.jfr is populated with JFR data during the application's runtime.

Actual Behavior

The file is created but remains empty, and the application logs the following a few times per second:

[warn][jfr,system ] Exception occurred during execution of flush task

Steps to Reproduce

From the graalvm-jfr-bug repo, ./compile.sh && ./run.sh. This requires Clojure to be installed.

If this correctly creates JFR data, simply run this again until it doesn't. In my experience, it ends up working about 50% of the time.

I wasn't able to attach them to this issue, but I've committed bundles of both a working and a non-working compilation:
https://github.com/dekelpilli/graalvm-jfr-bug/blob/master/error_not_present_bundle.nib
https://github.com/dekelpilli/graalvm-jfr-bug/blob/master/error_present_bundle.nib

Additional Context

No response

Run-Time Log Output and Error Messages

[warn][jfr,system ] Exception occurred during execution of flush task

@roberttoyonaga
Copy link
Collaborator

roberttoyonaga commented Feb 24, 2025

Hi @dekelpilli. Thanks for reporting this. I was able to reproduce the problem using the example you provided. I have made a fix here: #10749

If you'd like to try out the fix on my branch yourself, here are some instructions on building GraalVM from source:
You need the mx build tool. You also need the latest labsjdk release.

Put mx on the path and set java home to labsjdk:
export PATH=/path/to/mx:$PATH
export JAVA_HOME=/path/to/labsjdk
Run mx --dynamicimports /substratevm build from the vm directory. And then run mx build from the graal/substratevm directory.
Then you can use mx native-image, or just find the native-image binary in the build directory graal/vm/latest_graalvm_home/bin/native-image.

The first few minutes of this video does a good job of explaining this as well: https://youtu.be/3Gh0cz3vjG8?feature=shared&t=202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants