Re: [PATCH] [PR 25678] gdb crashes with "internal-error: sect_index_text not initialized" when .text

Simon Marchi
2020-05-14T19:28:08Z

On 2020-05-14 3:12 p.m., mlimber via Gdb-patches wrote:
> Unfortunately, the simpler repro cases I have tried don't trigger the
> failure, e.g.,
>
> // main.c
> extern int g_global_var;
> int main()
> {
> return g_global_var;
> }
>
> // libglobal.c
> extern int g_global_var;
> int g_global_var = 42;
>
> I build it like:
>
> gcc -shared -nostdlib -fPIC -o libglobal.so libglobal.c
> gcc -o main main.c -lglobal -L. -Wl,--rpath,\$ORIGIN
>
> Running it in GDB works fine. Seems like something more is required.
>
> Even following the repro steps listed in the first comment or linking
> against libicudata.so in a simple program like above work fine for me.
>
> My more complicated, real-world use case does consistently repro the bug
> before the patch but does not after.
>
> More digging required. Suggestions welcome!
>
> M

If you can make a reproducer that uses Qt, that's a good start. Then we can
track down what's special about this use case, and try to make a reproducer
that doesn't use it.

But for the record, I was able to reproduce the crash using the instructions
in the bug. Keith (comment 3) did too.

Simon