JDK-8318682 : SA decoding of scalar replaced objects is broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 22,23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-10-23
  • Updated: 2024-05-06
  • Resolved: 2024-04-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23
23 b21Fixed
Related Reports
Relates :  
Description
JDK-8287061 changed the format of ObjectValues in debug info but the SA wasn't updated.  Additionally there are a couple of new types like MarkerValue, AutoBoxObjectValue and ObjectMergeValue which are unhandled.  Decoding these values isn't critical to producing useful output so it might be worth treating decoding problems during decodeObjectValues as non-fatal.  It's also missing JDK-8204209 which interferes with some cases for Graal.
Comments
Changeset: b96b38c2 Author: Tom Rodriguez <never@openjdk.org> Date: 2024-04-30 17:33:23 +0000 URL: https://git.openjdk.org/jdk/commit/b96b38c2c9a310d5fe49b2eda3e113a71223c7d1
30-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17407 Date: 2024-01-12 21:26:36 +0000
12-01-2024

Great, thanks Tom!
10-01-2024

I hadn't considered that this was a regression. I can probably get it done in the next day or so. I just need to polish the test a bit.
10-01-2024

[~never] Do you plan to get this fix into JDK 22? Since this is a P3, the deadline would be Jan 18 already. If not, we should issue a defer request since it's a regression from JDK-8287061 in JDK 22.
10-01-2024

You can use the TraceReduceAllocationMerges flag to see if the optimization is really happening in the test. Make sure that `dummy` is not being Inlined. Also, you can delete its body as you don't need to trigger a GC.
17-11-2023

Perfect, I'll just need to extract the HeapDumper part into a ClhsdbLauncher.java based test that checks for the proper output in the SA decoded dump.
17-11-2023

The test I added to this PR does exactly what you asked: https://github.com/openjdk/jdk/pull/16622
17-11-2023

For the test it might helpful if you could supply some sample code where an ObjectMergeValue ends up in the debug info. I've written the SA decoding of that but haven't been able to test it yet.
17-11-2023

Thanks for pinging [~thartmann]. [~never] I created the ObjectMergeValue class, let me know if you need any input or help from me, and I'll be glad to assist.
17-11-2023

I have a changeset with the fixes plus a test but the test ends up exercising other unrelated SA stuff that is also broken. I think I need to make the test a little more directed and maybe include my more aggressive variant as a disabled test with an associated new bug. I'll try to get the updated PR up next week.
17-11-2023

Paging [~cslucas]
17-11-2023

I agree though testing it is a bit challenging. I'll look at some of the other tests to see if they provide an example I can derive from. I tested it by running Xcomp with PrintNMethod and pulling a core after main. Then I just tried to print everything in the code cache and looked for failure message. Not pretty but seemed to get pretty good coverage. It's too bad the SA isn't structured in a more standalone way so you could write unit tests for individual pieces in a single JVM.
24-10-2023

We should add a test to avoid breaking it again.
24-10-2023

ILW = Serviceability Agent fails to decode scalar replaced objects, with C2, no workaround = MMH = P3
24-10-2023