[Bug symtab/25065] New: GDB segfaults while running gdb.cp/subtypes.exp with -flto

kevinb at redhat dot com sourceware-bugzilla@sourceware.org
Sat Oct 5 20:44:00 GMT 2019


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

            Bug ID: 25065
           Summary: GDB segfaults while running gdb.cp/subtypes.exp with
                    -flto
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: kevinb at redhat dot com
  Target Milestone: ---

Created attachment 12018
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12018&action=edit
Patch which fixes this -flto bug

Using the installed gcc (gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1)) on Fedora
30, GDB dies with a SIGSEGV while testing gdb.cp/subtypes.exp when used with
the -flto flag.

The command line to reproduce this is:

make check RUNTESTFLAGS="CFLAGS_FOR_TARGET='-flto' --target_board unix
gdb.cp/subtypes.exp"

Here is the relevant part of the log file showing the segfault:

ptype main::Foo
type = struct Foo {
ERROR: GDB process no longer exists
GDB process exited with wait status 9481 exp11 0 0 CHILDKILLED SIGSEGV
{segmentation violation}

I've investigated this problem and have a fix for it though I'm still working
on a test case which doesn't require running the test with -flto.  I'm
attaching my current patch.  I plan to submit this patch (or one that's
similar) for upstream consideration once I have a test case.

Another reproducer for this bug is gdb.cp/local.exp:

make check RUNTESTFLAGS="CFLAGS_FOR_TARGET='-flto' --target_board unix
gdb.cp/local.exp"

For this one, the relevant lines from the log file are as follows:

ptype l
type = class Local {
  public:
    int loc1;

ERROR: GDB process no longer exists
GDB process exited with wait status 9730 exp12 0 0 CHILDKILLED SIGSEGV
{segmentation violation}

I'm fairly confident that these are the same bug. My patch fixes both of them.

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


More information about the Gdb-prs mailing list