No debugging symbols found when trying to debug openjdk

Bug #2016739 reported by Vladimir Petko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openjdk-17 (Ubuntu)
Fix Released
Undecided
Unassigned
openjdk-20 (Ubuntu)
Fix Released
Undecided
Unassigned
openjdk-lts (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

It is impossible to find openjdk-17 debug symbols - they are other empty or corrupted.

This is a regression over previous package version 17.0.6+10-1ubuntu2 making impossible to debug openjdk-17 issues.

The reason of the regression: missed testing.
- d/rules patches build-id using too broad wildcard and corrupts the debuginfo checksum
- dh_strip copies out debug symbol sections (which are empty due to native debug symbols = external). dh_strip also strips public symbols, which are necessary for native memory tracking LP: #2012326. The action implemented in dh_strip are unnecessary at this stage.

Proposed change:
 - repack symbols in build-id format in d/rules script
 - disable dh_strip (this prevents copying of debug sections and also symbol stripping)

[Test Plan]

- validate that openjdk-17 can be debugged with gdb after installing openjdk-17-jdk and openjdk-17-dbg
- validate that native memory tracking works
- validate that the installed size of openjdk-17 does not exceed that of the temurin distribution.

[ Where problems could occur ]

This covers the edge cases not in the main test plan:
 - empty directories left in the debug symbols due to repack
 - debuginfo files left bloating the debug package

[ Other Info ]

Disabling dh_strip also addresses LP: #2012326

Original bug report:

When trying to debug openjdk-20 following error occurs:

-------------------------cut------------------------------------
 gdb /usr/lib/jvm/java-20-openjdk-amd64/bin/java
GNU gdb (Ubuntu 13.1-2ubuntu2) 13.1
Copyright (C) 2023 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-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 /usr/lib/jvm/java-20-openjdk-amd64/bin/java...
Reading symbols from /usr/lib/debug/.build-id/d1/6b7825e5ce53f77f4e4010b488bd3cd430ab41.debug...
(No debugging symbols found in /usr/lib/debug/.build-id/d1/6b7825e5ce53f77f4e4010b488bd3cd430ab41.debug)

---------------------------------------------------------------------

trying to use .debuginfo symbols:

----------------------------cut----------------------------------------------

bsp@lunar:~$ gdb /usr/lib/jvm/java-20-openjdk-amd64/bin/java
GNU gdb (Ubuntu 13.1-2ubuntu2) 13.1
Copyright (C) 2023 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-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 /usr/lib/jvm/java-20-openjdk-amd64/bin/java...

warning: the debug information found in "/usr/lib/debug//usr/lib/jvm/java-20-openjdk-amd64/bin/java.debuginfo" does not match "/usr/lib/jvm/java-20-openjdk-amd64/bin/java" (CRC mismatch).
----------------------------------------------------------------------

Related branches

Revision history for this message
Vladimir Petko (vpa1977) wrote :

Seems to be caused by external debug symbols change LP: #2015835

Vladimir Petko (vpa1977)
description: updated
description: updated
tags: added: regression-proposed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-lts - 11.0.19+7~us1-0ubuntu1~23.04

---------------
openjdk-lts (11.0.19+7~us1-0ubuntu1~23.04) lunar-security; urgency=medium

  * Upload to Ubuntu 23.04.

openjdk-lts (11.0.19+7~us1-0ubuntu1) mantic; urgency=medium

  * OpenJDK 11.0.19 release, build 7.
    - CVE-2023-21930, CVE-2023-21937, CVE-2023-21938, CVE-2023-21939,
      CVE-2023-21954, CVE-2023-21967, CVE-2023-21968.
    - Release notes:
      https://mail.openjdk.org/pipermail/jdk-updates-dev/2023-April/021900.html
    - d/p/*: refresh patches.
  * d/rules: pack external debug symbols with build-id, do not pack duplicate
    symbols, do not strip JVM shared libraries (LP: #2012326, LP: #2016739).
  * d/rules: always use jtreg6.

 -- Vladimir Petko <email address hidden> Sat, 06 May 2023 12:26:45 +0200

Changed in openjdk-lts (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-17 - 17.0.7+7~us1-0ubuntu1~23.04

---------------
openjdk-17 (17.0.7+7~us1-0ubuntu1~23.04) lunar-security; urgency=medium

  * Upload to Ubuntu 23.04.

openjdk-17 (17.0.7+7~us1-0ubuntu1) mantic; urgency=medium

  * OpenJDK 17.0.7 release, build 7.
    - CVE-2023-21930, CVE-2023-21937, CVE-2023-21938, CVE-2023-21939,
      CVE-2023-21954, CVE-2023-21967, CVE-2023-21968.
    - Release notes:
      https://mail.openjdk.org/pipermail/jdk-updates-dev/2023-April/021899.html
  * d/rules: update jquery to 3.6.1.
  * d/p/*: refresh patches.
  * d/rules: pack external debug symbols with build-id, do not pack duplicate
    symbols, do not strip JVM shared libraries (LP: #2012326, LP: #2016739).
  * d/p/system-pcsclite.diff: disable built-in pcsclite version assertion.
  * d/rules: always use jtreg6.
  * d/rules: only compile google tests when with_check is enabled, disable them
    for bullseye and jammy.

 -- Vladimir Petko <email address hidden> Sat, 06 May 2023 12:03:41 +0200

Changed in openjdk-17 (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openjdk-20 - 20.0.1+9~us1-0ubuntu1~23.04

---------------
openjdk-20 (20.0.1+9~us1-0ubuntu1~23.04) lunar-security; urgency=medium

  * Upload to Ubuntu 23.04.

openjdk-20 (20.0.1+9~us1-0ubuntu1) mantic; urgency=medium

  * OpenJDK 20.0.1 release, build 9.
    - CVE-2023-21930, CVE-2023-21937, CVE-2023-21938, CVE-2023-21939,
      CVE-2023-21954, CVE-2023-21967, CVE-2023-21968.
    - Release notes:
      https://adoptium.net/en-GB/temurin/release-notes/?version=jdk-20.0.1+9
  * d/p/*: refresh patches.
  * d/watch: update version format for the security release.
  * d/rules: pack external debug symbols with build-id, do not pack duplicate
    symbols, do not strip JVM shared libraries (LP: #2012326, LP: #2016739).
  * d/rules: disable jtreg tests in kinetic, no jtreg7 package.
  * d/rules: only compile google tests when with_check is enabled, disable them
    for bullseye and jammy.

 -- Vladimir Petko <email address hidden> Sat, 06 May 2023 13:22:21 +0200

Changed in openjdk-20 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.