Bug 2041970 - gdb backtrace fails with 'internal-error: sect_index_data not initialized'
Summary: gdb backtrace fails with 'internal-error: sect_index_data not initialized'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: java-latest-openjdk
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Severin Gehwolf
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 2042664
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-18 16:11 UTC by Severin Gehwolf
Modified: 2022-02-17 22:31 UTC (History)
4 users (show)

Fixed In Version: java-latest-openjdk-17.0.2.0.8-4.rolling.fc36 java-latest-openjdk-17.0.2.0.8-5.rolling.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-09 16:41:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Severin Gehwolf 2022-01-18 16:11:27 UTC
Description of problem:
In java-latest-openjdk we have a gdb backtrace check so as to ensure debug information is there for the OpenJDK build. It started failing in rawhide with the gcc 12 update in rawhide on 2022-01-14 and needs to be investigated.

Version-Release number of selected component (if applicable):
1:17.0.1.0.12-15.rolling

How reproducible:
100%

Steps to Reproduce:
1. fedpkg clone java-latest-openjdk && cd java-latest-openjdk && fedpkg build

Actual results:
gdb check fails with:

+ gdb -q /builddir/build/BUILD/java-17-openjdk-17.0.1.0.12-15.rolling.fc36.x86_64/build/jdk17.build-slowdebug-main/images/jdk/bin/java
+ tee gdb.out
Reading symbols from /builddir/build/BUILD/java-17-openjdk-17.0.1.0.12-15.rolling.fc36.x86_64/build/jdk17.build-slowdebug-main/images/jdk/bin/java...
(gdb) Signal        Stop	Print	Pass to program	Description
SIGSEGV       No	No	Yes		Segmentation fault
(gdb) Signal        Stop	Print	Pass to program	Description
SIGILL        No	No	Yes		Illegal instruction
(gdb) (gdb) No source file named javaCalls.cpp.
Breakpoint 1 (javaCalls.cpp:1) pending.
(gdb) >>>(gdb) 
Starting program: /builddir/build/BUILD/java-17-openjdk-17.0.1.0.12-15.rolling.fc36.x86_64/build/jdk17.build-slowdebug-main/images/jdk/bin/java -version
This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.fedoraproject.org/ 
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
../../gdb/objfiles.h:510: internal-error: sect_index_data not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]
This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.
+ grep JavaCallWrapper::JavaCallWrapper gdb.out
error: Bad exit status from /var/tmp/rpm-tmp.IJo5Om (%check)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.IJo5Om (%check)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.10/site-packages/mockbuild/util.py", line 600, in do_with_status
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed: 

Expected results:
gdb check passes

Additional info:
Link to failed task
https://koji.fedoraproject.org/koji/taskinfo?taskID=81387738

Koschei link:
https://koschei.fedoraproject.org/package/java-latest-openjdk?collection=f36

Comment 1 Andrew John Hughes 2022-01-18 18:06:24 UTC
This affects x86, x86_64, ppc64le and (now confirmed by re-enabling it) s390x.

s390x may still be broken even if this particular bug is fixed; it has been disabled for a long time.

s390x logs: https://koji.fedoraproject.org/koji/taskinfo?taskID=81412068

Comment 2 Andrew John Hughes 2022-01-19 17:10:07 UTC
s390x hits it both on 11u & 17u (JIT) and 8u (Zero), FWIW.

Comment 3 Severin Gehwolf 2022-01-27 17:42:00 UTC
This is actually bug 2042664 and can be reproduced by using gdb from rawhide to debug this simple program (install java-1.8.0-openjdk-devel first):

$ cat dlopen_test.c 
#include <stdio.h>
#include <dlfcn.h>

int main() {
   void *libjvm;
   libjvm = dlopen("libjvm.so", RTLD_NOW + RTLD_GLOBAL);
   printf("libjvm == %ld\n", (unsigned long)libjvm);
   return 0;
}
$ export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/amd64/server
$ gdb ./a.out 
GNU gdb (GDB) Fedora 11.1-9.fc36
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 ./a.out...
(gdb) break dlopen
Breakpoint 1 at 0x401040
(gdb) run
Starting program: /a.out 

This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.fedoraproject.org/ 
Enable debuginfod for this session? (y or [n]) n
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x00007ffff7e46a90 in dlopen.5 () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7e46a90 in dlopen.5 () from /lib64/libc.so.6
#1  0x000000000040114d in main () at dlopen_test.c:6
(gdb) next
Single stepping until exit from function dlopen.5,
which has no line number information.
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.34.9000-36.fc36.x86_64 java-1.8.0-openjdk-headless-1.8.0.322.b04-0.1.ea.fc36.x86_64 libgcc-12.0.1-0.2.fc36.x86_64 libstdc++-12.0.1-0.2.fc36.x86_64
../../gdb/objfiles.h:510: internal-error: sect_index_data not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
[...]
$ rpm -q gdb
gdb-11.1-9.fc36.x86_64

Comment 4 Fedora Update System 2022-02-07 07:53:26 UTC
FEDORA-2022-8a2e133345 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-8a2e133345

Comment 5 Fedora Update System 2022-02-07 07:56:51 UTC
FEDORA-2022-8a2e133345 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Severin Gehwolf 2022-02-07 10:15:44 UTC
Re-opening as the update in question merely disabled the gdb check. We should re-enable now that the dependent bug is fixed.

Comment 7 Severin Gehwolf 2022-02-07 13:07:04 UTC
https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/c/2988ce90ffc176c047dcb63bb70e4c8ca1ec6d88?branch=rawhide was the commit (as the update referenced a java-1.8.0-openjdk build).

Comment 8 Andrew John Hughes 2022-02-07 13:22:45 UTC
(In reply to Severin Gehwolf from comment #6)
> Re-opening as the update in question merely disabled the gdb check. We
> should re-enable now that the dependent bug is fixed.

Yes, sadly the Fedora system seems unable to tell the difference between 'Resolved' and 'Related'. Thanks for reopening.

Comment 9 Ben Cotton 2022-02-08 20:09:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.

Comment 10 Fedora Update System 2022-02-08 22:35:14 UTC
FEDORA-2022-b63ee3f2ac has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b63ee3f2ac

Comment 11 Fedora Update System 2022-02-09 16:41:43 UTC
FEDORA-2022-b63ee3f2ac has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2022-02-17 22:25:35 UTC
FEDORA-2022-b35a3762ab has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b35a3762ab

Comment 13 Fedora Update System 2022-02-17 22:31:33 UTC
FEDORA-2022-b35a3762ab has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.