[Bug c++/28908] New: Assertion `strstr (name, "::") == NULL' failed. listing member function names of a namespace class

msebor at gmail dot com sourceware-bugzilla@sourceware.org
Fri Feb 18 21:53:20 GMT 2022


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

            Bug ID: 28908
           Summary: Assertion `strstr (name, "::") == NULL' failed.
                    listing member function names of a namespace class
           Product: gdb
           Version: 11.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: msebor at gmail dot com
  Target Milestone: ---

I encountered the following internal error while testing the fix for pr28901. 
The error is with GNU gdb (GDB) Fedora 11.1-5.fc35 but it's reproducible with
trunk.

$ cat t.C && g++ -g3 t.C && gdb -batch -nx -ex "break main" -ex run -ex "print
(N::A*)&b" -ex "list $1->N::A::f" a.out
namespace N {
  struct A { void f () { } };
  struct B: A { };
}

N::B b;

int main ()
{
  b.f ();
}
Breakpoint 1 at 0x40110a: file t.C, line 10.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main () at t.C:10
10        b.f ();
$1 = (N::A *) 0x40401d <b>
../../gdb/cp-namespace.c:178: internal-error: block_symbol
cp_lookup_bare_symbol(const language_defn*, const char*, const block*,
domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
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/>.

../../gdb/cp-namespace.c:178: internal-error: block_symbol
cp_lookup_bare_symbol(const language_defn*, const char*, const block*,
domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)

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


More information about the Gdb-prs mailing list