This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445:internal-error: expand_line_sal_maybe: Assertion `found' failed.


http://sourceware.org/bugzilla/show_bug.cgi?id=12573

           Summary: ../../src/gdb/breakpoint.c:7445: internal-error:
                    expand_line_sal_maybe: Assertion `found' failed.
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: critical
          Priority: P2
         Component: breakpoints
        AssignedTo: unassigned@sourceware.org
        ReportedBy: ppluzhnikov@google.com


The following test case triggers:

../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe:
Assertion `found' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Aborted (core dumped)

at current HEAD (7.2.50.20110311-cvs) when setting a breakpoint on Bar::Bar.

As far as I can tell, this is happening because skip_prologue_sal()
returns a "bad" sal when it detects inlined function.

If I make skip_prologue_sal into a no-op, then the breakpoint is set
properly, and there is no crash.

This could be a duplicate of Bug 11031, but I have a test case to reproduce
this with:

/// --- cut --- foo.cc ---
#include <stdlib.h>

struct Foo {
  Foo(int) __attribute__((always_inline));
  int x;
};

struct Bar {
  Bar(int) __attribute__((noinline));

  Foo f;
  int x;
};

Bar::Bar(int i)
  : f(i),
    x(i)
{
}

Foo::Foo(int i)
  : x(i)
{
  free(malloc(1));
}

int main()
{
  Bar b(42);
  return b.x + b.f.x;
}
/// --- cut --- foo.cc ---

Build with:

 g++  -g -O2 foo.cc -fno-omit-frame-pointer

(note: frame pointer is important to repro the problem!)

gdb -ex 'break Bar::Bar' a.out
GNU gdb (GDB) 7.2.50.20110311-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/a.out...done.
../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe:
Assertion `found' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Aborted (core dumped)



The problem reproduces with gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5),
but not with GCC 4.6.0 20110219 (experimental).

I am attach the binary in case your copy of GCC produces something that
does not trigger the problem.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]