[Bug gdb/24620] New: SIGSEGV in write_one_signatured_type with cc-with-gdb-index in fission-reread

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

[Bug gdb/24620] New: SIGSEGV in write_one_signatured_type with cc-with-gdb-index in fission-reread

konrad.schwarz at siemens dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24620

            Bug ID: 24620
           Summary: SIGSEGV in write_one_signatured_type with
                    cc-with-gdb-index in fission-reread
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

When running gdb.dwarf2/fission-reread with target board cc-with-gdb-index, we
run into:
...
Running
/data/gdb_versions/devel/src/gdb/testsuite/gdb.dwarf2/fission-reread.exp ...
gdb compile failed, warning: Could not find DWO TU
fission-reread.dwo(0x9022f1ceac7e8b19) referenced by TU at offset 0x0 [in
module
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread/fission-reread]
warning: Could not find DWO CU fission-reread.dwo(0x807060504030201) referenced
by CU at offset 0xc7 [in module
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread/fission-reread]
/data/gdb_versions/devel/build/gdb/testsuite/gdb.sh: line 1:  7808 Segmentation
fault      (core dumped)
/data/gdb_versions/devel/build/gdb/testsuite/../../gdb/gdb -nw -nx
-data-directory /data/gdb_versions/devel/build/gdb/testsuite/../data-directory
-ex "set sysroot" "$@"
...

In more detail:
...
$ gdb --batch -nx -iex 'set auto-load no' -ex 'file
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread/fission-reread'
-ex 'save gdb-index
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread'
warning: Could not find DWO TU fission-reread.dwo(0x9022f1ceac7e8b19)
referenced by TU at offset 0x0 [in module
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread/fission-reread]
warning: Could not find DWO CU fission-reread.dwo(0x807060504030201) referenced
by CU at offset 0xc7 [in module
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread/fission-reread]
Segmentation fault (core dumped)
...

Corresponding backtrace:
...
Thread 1 "gdb" received signal SIGSEGV, Segmentation fault.
0x00000000005874ad in write_one_signatured_type (slot=0x1a4e1a0,
d=0x7fffffffcff0)
    at /data/gdb_versions/devel/src/gdb/dwarf-index-write.c:583
583       write_psymbols (info->symtab,
(gdb) bt
#0  0x00000000005874ad in write_one_signatured_type (slot=0x1a4e1a0,
d=0x7fffffffcff0)
    at /data/gdb_versions/devel/src/gdb/dwarf-index-write.c:583
#1  0x0000000000a80a61 in htab_traverse_noresize (htab=0x1a4e010,
    callback=0x58746d <write_one_signatured_type(void**, void*)>,
info=0x7fffffffcff0)
    at /data/gdb_versions/devel/src/libiberty/hashtab.c:775
#2  0x0000000000587cf3 in write_gdbindex (dwarf2_per_objfile=0x1a9bd10,
out_file=0x12ecd40)
    at /data/gdb_versions/devel/src/gdb/dwarf-index-write.c:1353
#3  0x0000000000588d88 in write_psymtabs_to_index
(dwarf2_per_objfile=0x1a9bd10,
    dir=0x7fffffffe0c7
"/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread",
    basename=0x1a74aef "fission-reread", index_kind=dw_index_kind::GDB_INDEX)
    at /data/gdb_versions/devel/src/gdb/dwarf-index-write.c:1626
#4  0x00000000005891a6 in save_gdb_index_command (
    arg=0x7fffffffe0c7
"/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread",
    from_tty=0) at /data/gdb_versions/devel/src/gdb/dwarf-index-write.c:1681
#5  0x00000000004f191e in do_const_cfunc (c=0x15f3be0,
    args=0x7fffffffe0c7
"/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread",
    from_tty=0) at /data/gdb_versions/devel/src/gdb/cli/cli-decode.c:106
#6  0x00000000004f46b5 in cmd_func (cmd=0x15f3be0,
    args=0x7fffffffe0c7
"/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread",
    from_tty=0) at /data/gdb_versions/devel/src/gdb/cli/cli-decode.c:1892
#7  0x00000000008c7973 in execute_command (p=0x7fffffffe114 "d", from_tty=0)
    at /data/gdb_versions/devel/src/gdb/top.c:630
#8  0x000000000071f738 in catch_command_errors (command=0x8c7585
<execute_command(char const*, int)>,
    arg=0x7fffffffe0b7 "save gdb-index
/data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.dwarf2/fission-reread",
from_tty=0) at /data/gdb_versions/devel/src/gdb/main.c:372
--Type <RET> for more, q to quit, c to continue without paging--
#9  0x0000000000720948 in captured_main_1 (context=0x7fffffffd9e0)
    at /data/gdb_versions/devel/src/gdb/main.c:1138
#10 0x0000000000720a88 in captured_main (data=0x7fffffffd9e0) at
/data/gdb_versions/devel/src/gdb/main.c:1163
#11 0x0000000000720af3 in gdb_main (args=0x7fffffffd9e0) at
/data/gdb_versions/devel/src/gdb/main.c:1188
#12 0x0000000000411f59 in main (argc=9, argv=0x7fffffffdae8) at
/data/gdb_versions/devel/src/gdb/gdb.c:32
...

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

[Bug gdb/24620] SIGSEGV in write_one_signatured_type with cc-with-gdb-index in fission-reread

konrad.schwarz at siemens dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24620

Tom de Vries <vries at gcc dot gnu.org> changed:

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

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

[Bug gdb/24620] SIGSEGV in write_one_signatured_type with cc-with-gdb-index in fission-reread

konrad.schwarz at siemens dot com
In reply to this post by konrad.schwarz at siemens dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24620

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c
index 8734f99212..7f88d31570 100644
--- a/gdb/dwarf-index-write.c
+++ b/gdb/dwarf-index-write.c
@@ -579,6 +579,8 @@ write_one_signatured_type (void **slot, void *d)
     = (struct signatured_type_index_data *) d;
   struct signatured_type *entry = (struct signatured_type *) *slot;
   struct partial_symtab *psymtab = entry->per_cu.v.psymtab;
+  if (psymtab == NULL)
+    return 1;

   write_psymbols (info->symtab,
                  info->psyms_seen,
...

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

[Bug gdb/24620] SIGSEGV in write_one_signatured_type with cc-with-gdb-index in fission-reread

konrad.schwarz at siemens dot com
In reply to this post by konrad.schwarz at siemens dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24620

--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
I see the same crash.  I tried to investigate a little bit, but I don't know
enough about type units and dwo files to understand what is happening.

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