JDK-8293201 : Library detection in runtime/ErrorHandling/TestDwarf.java fails on some systems
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-09-01
  • Updated: 2023-12-22
  • Resolved: 2022-09-01
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 20
20 b14Fixed
Related Reports
Relates :  
Relates :  
Description
This is observed in GHA after update to Ubuntu 22.04. 

```
[dwarf] ##### Find filename and line number for offset 0x00085ff1 in library /lib32/libc.so.6 #####
[dwarf] Failed to load DWARF file for library /lib32/libc.so.6 or find DWARF sections directly inside it.
#
# Compiler replay data is saved as:
# /home/runner/work/jdk/jdk/build/run-test-prebuilt/test-support/jtreg_test_hotspot_jtreg_tier1_runtime/scratch/replay_pid4906.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

hs_err_file: hs_err_pid4906.log
----------System.err:(16/999)----------
java.lang.RuntimeException: Must find library in "C  [libc.so.6+0x85ff1]": expected true, was false
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertTrue(Asserts.java:486)
	at TestDwarf.checkNoSourceLine(TestDwarf.java:181)
	at TestDwarf.runAndCheck(TestDwarf.java:153)
	at TestDwarf.test(TestDwarf.java:101)
	at TestDwarf.main(TestDwarf.java:91)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:1589)

JavaTest Message: Test threw exception: java.lang.RuntimeException: Must find library in "C  [libc.so.6+0x85ff1]": expected true, was false
JavaTest Message: shutting down test
```

The regexp that the test uses seems too broad.
Comments
Fix request 17u. Backporting this fix for the GHA failures seen in backporting of https://bugs.openjdk.org/browse/JDK-8242181 Patch applies cleanly.
13-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2031 Date: 2023-12-08 23:50:35 +0000
08-12-2023

Looks like the '-' in the lib name libpthread-2.28.so is not allowed currently by the test. This is wrong, a '-' shows up rather often in lib names (just check your local /usr/lib64 on some distro and some examples show up). I created https://bugs.openjdk.org/browse/JDK-8303973 .
10-03-2023

We got a error in runtime/ErrorHandling/TestDwarf.java after moving our Linux ppc64le tests to a newer machine (RHEL8.5). Before the test worked , now we get this (looks a bit similar to JDK-8293201) : [dwarf] ##### Find filename and line number for offset 0x000096a8 in library /lib64/glibc-hwcaps/power9/libpthread-2.28.so ##### [dwarf] Failed to load DWARF file for library /lib64/glibc-hwcaps/power9/libpthread-2.28.so or find DWARF sections directly inside it. and in stderr java.lang.RuntimeException: Must find library in "C [libpthread-2.28.so+0x96a8] start_thread+0xf8": expected true, was false Do we maybe need a regex adjustment too? Or is it more complicated ?
10-03-2023

Changeset: 52045282 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-09-01 14:13:51 +0000 URL: https://git.openjdk.org/jdk/commit/5204528296a53d7dc77e67b26be23a64692527fa
01-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10113 Date: 2022-09-01 08:32:17 +0000
01-09-2022