public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/28539] New: segfault in search_one_symtab
@ 2021-11-03 16:43 vries at gcc dot gnu.org
  2021-11-03 16:45 ` [Bug symtab/28539] " vries at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2021-11-03 16:43 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28539

            Bug ID: 28539
           Summary: segfault in search_one_symtab
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

A user reported a gdb crash with gdb-11.1 (
https://bugzilla.opensuse.org/show_bug.cgi?id=1192285 ) and shared the
reproducer with me.

The reproducer is something like:
...
$ gdb -q -batch exec core -ex bt
...

I managed to reproduce with master.

AFAIU, the following happens.

psymbol_functions::expand_symtabs_matching is called and we arrive here:
...
          struct compunit_symtab *symtab =
            psymtab_to_symtab (objfile, ps);

          if (expansion_notify != NULL)
            if (!expansion_notify (symtab))
              return false;
...
with symtab == nullptr due to ps being a dwarf2_include_psymtab.

The expansion_notify is lambda function search_one_symtab, as passed by
objfile::lookup_symbol and the null pointer is dereferenced here:
...
  auto search_one_symtab = [&] (compunit_symtab *stab)
  {
    ...
    const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (stab);
...

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-29 15:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 16:43 [Bug symtab/28539] New: segfault in search_one_symtab vries at gcc dot gnu.org
2021-11-03 16:45 ` [Bug symtab/28539] " vries at gcc dot gnu.org
2021-11-12 17:17 ` vries at gcc dot gnu.org
2021-11-14 18:23 ` vries at gcc dot gnu.org
2021-11-29 11:40 ` jirislaby at gmail dot com
2021-11-29 15:23 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).