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 Leak profiler does not write constant data correctly #10247

Open
1 of 2 tasks
roberttoyonaga opened this issue Dec 5, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@roberttoyonaga
Copy link
Collaborator

Describe the Issue

What's happening in Hotspot is that the thread and stacktrace constant data are being cached and only written out when the OldObjectSample events get emitted. OldObjectSample events are special because they are only emitted at the end of a recording, not every chunk rotation. However, in SVM we are serializing the thread and stacktrace data normally like we do for any other event. This is bad because the constant data may get written out too early in chunk1 while the recording later finishes in chunk2. Thus separating the constant and event data. We probably didn't catch this before in tests because test recordings are generally only 1 chunk long.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

All versions of GraalVM that contain support for the OldObjectSample event are affected, even master.

Operating System and Version

Fedora linux

Troubleshooting Confirmation

Run Command

N/A

Expected Behavior

When a recording consists of two chunks, the OldObjectSample events in emitted when the recording ends (in the 2nd chunk) should have readable constant data.

Actual Behavior

Thread and stacktrace data cannot be read of samples taken in the first chunk. The second chunk is unaffected.

Steps to Reproduce

  1. Start a JFR recording with the OldObjectSample event enabled.
  2. Allow sampling in the first chunk.
  3. Force a chunk rotation by dumping the recording data to a file.
  4. Allow sampling in the second chunk.
  5. End the recording and inspect the .jfr file.
  6. Notice that samples taken in the 2nd chunk do not have readable constant data.

Additional Context

No response

Run-Time Log Output and Error Messages

No response

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

1 participant