[Bug symtab/25678] New: gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] New: gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

            Bug ID: 25678
           Summary: gdb crashes with "internal-error: sect_index_text not
                    initialized" when .text missing and >2 segments
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: klkblake at gmail dot com
  Target Milestone: ---

Created attachment 12379
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12379&action=edit
testcase for sect_index_text crash

When loading a shared library that has no .text section, and does not have
either 1 or 2 segments, gdb will fail with "internal-error: sect_index_text not
initialized". I've attached a minimal testcase.

$ cat >test.c <<EOF
int main() {}
EOF
$ gcc test.c ./libtestcase.so
$ gdb ./a.out
... <snip> ...
GNU gdb (GDB) 10.0.50.20200307-git
... <snip> ...
Reading symbols from ./a.out...
(gdb) r
Starting program: /tmp/a.out
../../gdb/objfiles.h:524: internal-error: sect_index_text not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

Qathy <thravran.qathy at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thravran.qathy at gmail dot com

--- Comment #1 from Qathy <thravran.qathy at gmail dot com> ---
Hello,

Using gdb 7.12.1, I'm currently experiencing a very similar issue, if not
exactly the same.
You'll find attached a stack obtained from the core generated by gdb at its
request on experiencing the following issue.

Reading symbols from
/usr/tmp_people/lps/tinony/dev/tina_lps42/Lib/libXm.so.4...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libXt.so.6...(no debugging
symbols found)...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libX11.so.6...(no debugging
symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...(no debugging
symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Reading symbols from /lib/x86_64-linux-gnu/libcrypt.so.1...(no debugging
symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...(no debugging symbols
found)...done.
Reading symbols from
/usr/tmp_people/lps/tinony/dev/tina_lps42/Lib/libicuuc.so.64...(no debugging
symbols found)...done.
Reading symbols from
/usr/tmp_people/lps/tinony/dev/tina_lps42/Lib/libicudata.so.64...../../gdb-7.12.1/gdb/symfile.c:969:
internal-error: sect_index_text not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

../../gdb-7.12.1/gdb/symfile.c:969: internal-error: sect_index_text not
initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) y
Command aborted.
(gdb) q
A debugging session is active.

        Inferior 1 [process 27615] will be detached.

Quit anyway? (y or n) y

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

--- Comment #2 from Qathy <thravran.qathy at gmail dot com> ---
Created attachment 12421
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12421&action=edit
Stack of gdb when encountering the issue

This file contains the stack obtained from the core which was produced by gdb
when it encountered the "internal-error: sect_index_text not initialized"

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
            Version|unknown                     |HEAD
                 CC|                            |keiths at redhat dot com
   Last reconfirmed|                            |2020-04-02

--- Comment #3 from Keith Seitz <keiths at redhat dot com> ---
I can confirm that this still happens on HEAD:

$ ./gdb 25678 -ex r
GNU gdb (GDB) 10.0.50.20200318-git
Copyright (C) 2020 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://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 25678...
(No debugging symbols found in 25678)
Starting program: /home/keiths/tmp/25678
../../src/gdb/objfiles.h:524: internal-error: sect_index_text not initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

--- Comment #4 from Qathy <thravran.qathy at gmail dot com> ---
As of now, and up to what I can understand, this issue seams to be triggered by
libicudata.so.64, as with *very* similar source code using libicudata.so.59 I
don't experience the issue.

Fortunately enough, I may revert to this previous version for the sake of my
current most urgent issue.

But for some of our new features, this revert sounds a bit more tricky and
we're eager to obtaining a gdb version compatible with libicudata.so.64

Thanks in advance.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

mlimber at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mlimber at gmail dot com

--- Comment #5 from mlimber at gmail dot com ---
Created attachment 12535
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12535&action=edit
Proposed patch to fix the problem

From patch by Jeremie Courreges-Anglas:
https://marc.info/?l=openbsd-ports&m=146569238229407&w=2

Needs a test case.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #6 from Simon Marchi <simark at simark dot ca> ---
To reproduce this on Ubuntu, I needed -Wl,--no-as-needed.  Otherwise, the
executable wouldn't be linked with libtestcase.so.

$ gcc test.c -Wl,--no-as-needed ./libtestcase.so -g3 -O0

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

Sergei Trofimovich <slyfox at inbox dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at inbox dot ru

--- Comment #7 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Also reported in Gentoo as https://bugs.gentoo.org/724614

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug symtab/25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text missing and >2 segments

Sourceware - gdb-prs mailing list
In reply to this post by glaubitz at physik dot fu-berlin.de
https://sourceware.org/bugzilla/show_bug.cgi?id=25678

--- Comment #8 from Sergei Trofimovich <slyfox at inbox dot ru> ---
On gdb-9.2 test case from #comment1 fails as:

"""
$ x86_64-pc-linux-gnu-gcc test.c ./libtestcase.so
$ gdb --quiet ./a.out
Reading symbols from ./a.out...
(gdb) r
Starting program: /tmp/a.out
../../gdb-9.2/gdb/dwarf2read.c:8080: internal-error: sect_index_text not
initialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
"""

--
You are receiving this mail because:
You are on the CC list for the bug.