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

JDK 17: Incorrect file name for lambda methods in DWARF info of images generated with Mandrel 21.3 #355

Closed
jerboaa opened this issue Jan 27, 2022 · 11 comments

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Jan 27, 2022

Description

This is similar to #266, but for JDK 17. The root cause must be different as the boot JDK has the fix for MetaUtil.java which we did for JDK 11 is present in OpenJDK 17. See:
https://github.com/openjdk/jdk17u/blob/6f0f42630eac1febf562062afc523fdf3d2a920a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java#L95

For the reproducer I see this:

$ strings ./debug-symbols-smoke-mandrel-21.3-jdk17 | grep com.oracle.svm.core.VM.Java.Version
com.oracle.svm.core.VM.Java.Version=17.0.2
$ strings ./debug-symbols-smoke-mandrel-21.3-jdk17 | grep com.oracle.svm.core.VM=
com.oracle.svm.core.VM=GraalVM 21.3.2-dev Java 17 Mandrel Distribution
$ gdb -ex 'info functions .*smoke.*' ./debug-symbols-smoke-mandrel-21.3-jdk17
GNU gdb (GDB) Fedora 11.1-5.fc35
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./debug-symbols-smoke-mandrel-21.3-jdk17...
All functions matching regular expression ".*smoke.*":

File debug_symbols_smoke/ClassA.java:
	java.lang.String *debug_symbols_smoke.ClassA::toString(void);

File debug_symbols_smoke/Main$$Lambda$605/0x00000007c0541b70.java:
	void debug_symbols_smoke.Main$$Lambda$605.0x00000007c0541b70::accept(java.lang.Object *);

File debug_symbols_smoke/Main.java:
	void debug_symbols_smoke.Main::lambda$thisIsTheEnd$0(java.io.ByteArrayOutputStream *, debug_symbols_smoke.ClassA *);
	void debug_symbols_smoke.Main::main(java.lang.String[] *);
	void debug_symbols_smoke.Main::thisIsTheEnd(java.util.List *);

Contrast this to a JDK 11-based mandrel 21.3 produced native image:

$ strings ./debug-symbols-smoke-mandrel-21.3-jdk11 | grep com.oracle.svm.core.VM=
com.oracle.svm.core.VM=GraalVM 21.3.0-dev Java 11 Mandrel Distribution
$ strings ./debug-symbols-smoke-mandrel-21.3-jdk11 | grep com.oracle.svm.core.VM.Java.Version
com.oracle.svm.core.VM.Java.Version=11.0.14-internal
$ gdb -ex 'info functions .*smoke.*' ./debug-symbols-smoke-mandrel-21.3-jdk11
GNU gdb (GDB) Fedora 11.1-5.fc35
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./debug-symbols-smoke-mandrel-21.3-jdk11...
All functions matching regular expression ".*smoke.*":

File debug_symbols_smoke/ClassA.java:
	java.lang.String *debug_symbols_smoke.ClassA::toString(void);

File debug_symbols_smoke/Main.java:
	void debug_symbols_smoke.Main$$Lambda$575/0x00000007c0d82c40::accept(java.lang.Object *);
	void debug_symbols_smoke.Main::lambda$thisIsTheEnd$0(java.io.ByteArrayOutputStream *, debug_symbols_smoke.ClassA *);
	void debug_symbols_smoke.Main::main(java.lang.String[] *);
	void debug_symbols_smoke.Main::thisIsTheEnd(java.util.List *);

Additional info:
I've noticed that the mandrel integration test for this fails for JDK 17-based builds.

Configuration:

  • OS: Fedora 35
  • Architecture: AMD64
  • Mandrel version: 21.3.1.0-Final
  • JDK version: 17.0.2+8
@jerboaa jerboaa added the bug Something isn't working label Jan 27, 2022
@jerboaa
Copy link
Collaborator Author

jerboaa commented Jan 27, 2022

/cc @zakkak

@zakkak
Copy link
Collaborator

zakkak commented Jan 27, 2022

Thanks for creating an issue for this @jerboaa , I am aware of this (due to the integration test failures) but I have been constantly de-prioritizing it. Are you having a look at this or shall I pick it up?

@zakkak zakkak changed the title JDK 17: Incorrect file name for lambda methods in DWARF info of images generated with Mandrel 21.1 JDK 17: Incorrect file name for lambda methods in DWARF info of images generated with Mandrel 21.3 Jan 27, 2022
@jerboaa
Copy link
Collaborator Author

jerboaa commented Jan 27, 2022

Thanks for creating an issue for this @jerboaa , I am aware of this (due to the integration test failures) but I have been constantly de-prioritizing it. Are you having a look at this or shall I pick it up?

@zakkak No cycles for this at the moment. Feel free to grab it.

@zakkak zakkak self-assigned this Jan 27, 2022
@zakkak
Copy link
Collaborator

zakkak commented Jan 28, 2022

Note, this issue is not Mandrel specific. The issue manifests in GraalVM CE builds as well.

It looks like the regression was introduced with openjdk/jdk17u@7cc1371 . From my current evaluation it looks like classes previously named debug_symbols_smoke/Main$$Lambda$615/0x00000007c0875b70 internally are now considered hidden classes as per JEP371 and are now being named debug_symbols_smoke/Main$$Lambda$615.0x00000007c0875b70 instead and jdk.vm.ci.meta.MetaUtil#replacePackageSeparatorsWithDot is not adapted to handle this. A naive fix seems to be the replacement of '.' with '/' in the beginning of jdk.vm.ci.meta.MetaUtil#replacePackageSeparatorsWithDot.

I will try to create tests and provide a proper fix probably next week.

@jerboaa
Copy link
Collaborator Author

jerboaa commented Jan 28, 2022

Thanks for the analysis! Feel free to bring this issue to upstream graal in that case. Thanks!

@zakkak
Copy link
Collaborator

zakkak commented Feb 4, 2022

This turned out to be an upstream OpenJDK issue. A proposed fix is submitted in openjdk/jdk#7346

@zakkak zakkak added pending upstream Issue or PR pending action on upstream repository (oracle/graal) affects/22.0 labels Feb 4, 2022
@github-actions
Copy link

github-actions bot commented Mar 7, 2022

This issue appears to be stale because it has been open 30 days with no activity. This issue will be closed in 7 days unless Stale label is removed, a new comment is made, or not-Stale label is added.

@github-actions github-actions bot added the Stale label Mar 7, 2022
@jerboaa jerboaa added not-Stale and removed Stale labels Mar 7, 2022
@zakkak
Copy link
Collaborator

zakkak commented Mar 21, 2022

Backport PR to jdk17u-dev fixing this issue: openjdk/jdk17u-dev#274

@zakkak
Copy link
Collaborator

zakkak commented Mar 23, 2022

Backport PR to jdk17u-dev fixing this issue: openjdk/jdk17u-dev#274

This is now merged and expected to land in OpenJDK 17.0.4

@jerboaa
Copy link
Collaborator Author

jerboaa commented May 6, 2022

This should be fixed with the latest temurin EA build from here (should identify as 17.0.14+1 something):
https://api.adoptium.net/v3/binary/latest/17/ea/linux/x64/jdk/hotspot/normal/eclipse

@zakkak
Copy link
Collaborator

zakkak commented May 11, 2022

This is indeed fixed (see https://github.com/graalvm/mandrel/runs/6363101190?check_suite_focus=true, the failure is in the AWT test not in the GDB one)

The fix will land in Mandrel 22.2.0.0 and 21.3.3.0.

@zakkak zakkak closed this as completed May 11, 2022
@zakkak zakkak added affects/22.1 and removed pending upstream Issue or PR pending action on upstream repository (oracle/graal) labels May 11, 2022
@zakkak zakkak added this to the 22.2.0.0-Final milestone May 11, 2022
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