public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
@ 2011-03-11 22:35 ppluzhnikov at google dot com
  2011-03-11 22:39 ` [Bug breakpoints/12573] " ppluzhnikov at google dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2011-03-11 22:35 UTC (permalink / raw)
  To: gdb-prs

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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
@ 2011-03-11 22:39 ` ppluzhnikov at google dot com
  2011-03-18 16:52 ` ppluzhnikov at google dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2011-03-11 22:39 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2011-03-11 22:39:26 UTC ---
Created attachment 5297
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5297
compressed binary which triggers 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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
  2011-03-11 22:39 ` [Bug breakpoints/12573] " ppluzhnikov at google dot com
@ 2011-03-18 16:52 ` ppluzhnikov at google dot com
  2011-04-12 10:18 ` jan.kratochvil at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ppluzhnikov at google dot com @ 2011-03-18 16:52 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2011-03-18 16:52:05 UTC ---
Apparently this has already been reported and a patch proposed:

http://sourceware.org/ml/gdb-patches/2010-07/msg00533.html
https://bugzilla.redhat.com/show_bug.cgi?id=612253

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
  2011-03-11 22:39 ` [Bug breakpoints/12573] " ppluzhnikov at google dot com
  2011-03-18 16:52 ` ppluzhnikov at google dot com
@ 2011-04-12 10:18 ` jan.kratochvil at redhat dot com
  2011-04-15 20:23 ` jan.kratochvil at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-04-12 10:18 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jan.kratochvil at redhat
                   |                            |dot com

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2011-04-12 10:18 ` jan.kratochvil at redhat dot com
@ 2011-04-15 20:23 ` jan.kratochvil at redhat dot com
  2011-05-06 15:07 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-04-15 20:23 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-04-15 20:21:51 UTC ---
[rfc, 7.3?] -O2 -g breakpoints internal error + prologue skipping
http://sourceware.org/ml/gdb-patches/2011-04/msg00229.html

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2011-04-15 20:23 ` jan.kratochvil at redhat dot com
@ 2011-05-06 15:07 ` cvs-commit at gcc dot gnu.org
  2011-05-06 15:14 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-05-06 15:07 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-05-06 15:06:53 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    jkratoch@sourceware.org    2011-05-06 15:06:49

Modified files:
    gdb            : ChangeLog dwarf2read.c symtab.c symtab.h 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.dwarf2: dw2-skip-prologue.S 
                              dw2-skip-prologue.c 
                              dw2-skip-prologue.exp 

Log message:
    gdb/
    PR 12573
    * dwarf2read.c (struct dwarf2_cu): New field has_loclist.
    (producer_is_gcc_ge_4_0): New function.
    (process_full_comp_unit): Set also symtab->locations_valid.  Move the
    symtab->language code.
    (var_decode_location): Set cu->has_loclist.
    * symtab.c (skip_prologue_sal): New variables saved_pc, force_skip and
    skip.  Intialize force_skip from locations_valid.  Move the prologue
    skipping code into two passes.
    * symtab.h (struct symtab): Make the primary field a bitfield.  New
    field locations_valid.

    gdb/testsuite/
    PR 12573
    * gdb.dwarf2/dw2-skip-prologue.S: New file.
    * gdb.dwarf2/dw2-skip-prologue.c: New file.
    * gdb.dwarf2/dw2-skip-prologue.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12982&r2=1.12983
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&r1=1.529&r2=1.530
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.c.diff?cvsroot=src&r1=1.271&r2=1.272
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.h.diff?cvsroot=src&r1=1.181&r2=1.182
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2698&r2=1.2699
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.c.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp.diff?cvsroot=src&r1=NONE&r2=1.1

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2011-05-06 15:07 ` cvs-commit at gcc dot gnu.org
@ 2011-05-06 15:14 ` cvs-commit at gcc dot gnu.org
  2011-05-06 15:21 ` jan.kratochvil at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2011-05-06 15:14 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2011-05-06 15:13:42 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_3-branch
Changes by:    jkratoch@sourceware.org    2011-05-06 15:13:38

Modified files:
    gdb            : ChangeLog dwarf2read.c symtab.c symtab.h 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.dwarf2: dw2-skip-prologue.S 
                              dw2-skip-prologue.c 
                              dw2-skip-prologue.exp 

Log message:
    gdb/
    PR 12573
    * dwarf2read.c (struct dwarf2_cu): New field has_loclist.
    (producer_is_gcc_ge_4_0): New function.
    (process_full_comp_unit): Set also symtab->locations_valid.  Move the
    symtab->language code.
    (var_decode_location): Set cu->has_loclist.
    * symtab.c (skip_prologue_sal): New variables saved_pc, force_skip and
    skip.  Intialize force_skip from locations_valid.  Move the prologue
    skipping code into two passes.
    * symtab.h (struct symtab): Make the primary field a bitfield.  New
    field locations_valid.

    gdb/testsuite/
    PR 12573
    * gdb.dwarf2/dw2-skip-prologue.S: New file.
    * gdb.dwarf2/dw2-skip-prologue.c: New file.
    * gdb.dwarf2/dw2-skip-prologue.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.12887.2.20&r2=1.12887.2.21
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2read.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.518.2.2&r2=1.518.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.262.2.2&r2=1.262.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/symtab.h.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.173.2.1&r2=1.173.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=1.2655.2.7&r2=1.2655.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.S.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.c.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/dw2-skip-prologue.exp.diff?cvsroot=src&only_with_tag=gdb_7_3-branch&r1=NONE&r2=1.1.2.1

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2011-05-06 15:14 ` cvs-commit at gcc dot gnu.org
@ 2011-05-06 15:21 ` jan.kratochvil at redhat dot com
  2011-05-30  8:24 ` jan.kratochvil at redhat dot com
  2012-02-08 19:32 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-05-06 15:21 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at sourceware    |jan.kratochvil at redhat
                   |dot org                     |dot com

--- Comment #6 from Jan Kratochvil <jan.kratochvil at redhat dot com> 2011-05-06 15:21:05 UTC ---
[commit+commit 7.3] -O2 -g breakpoints internal error + prologue skipping (PR
12573)
http://sourceware.org/ml/gdb-patches/2011-05/msg00190.html

GNU gdb (GDB) 7.3.50.20110506-cvs
GNU gdb (GDB) 7.2.90.20110506-cvs
Breakpoint 1 at 0x400600: file foo.cc, line 15. (2 locations)

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (6 preceding siblings ...)
  2011-05-06 15:21 ` jan.kratochvil at redhat dot com
@ 2011-05-30  8:24 ` jan.kratochvil at redhat dot com
  2012-02-08 19:32 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jan.kratochvil at redhat dot com @ 2011-05-30  8:24 UTC (permalink / raw)
  To: gdb-prs

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

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |12822

-- 
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.


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

* [Bug breakpoints/12573] ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed.
  2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
                   ` (7 preceding siblings ...)
  2011-05-30  8:24 ` jan.kratochvil at redhat dot com
@ 2012-02-08 19:32 ` tromey at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2012-02-08 19:32 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |magg.gatech at gmail dot
                   |                            |com

--- Comment #7 from Tom Tromey <tromey at redhat dot com> 2012-02-08 19:30:49 UTC ---
*** Bug 13674 has been marked as a duplicate of this bug. ***

-- 
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.


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

end of thread, other threads:[~2012-02-08 19:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-11 22:35 [Bug breakpoints/12573] New: ../../src/gdb/breakpoint.c:7445: internal-error: expand_line_sal_maybe: Assertion `found' failed ppluzhnikov at google dot com
2011-03-11 22:39 ` [Bug breakpoints/12573] " ppluzhnikov at google dot com
2011-03-18 16:52 ` ppluzhnikov at google dot com
2011-04-12 10:18 ` jan.kratochvil at redhat dot com
2011-04-15 20:23 ` jan.kratochvil at redhat dot com
2011-05-06 15:07 ` cvs-commit at gcc dot gnu.org
2011-05-06 15:14 ` cvs-commit at gcc dot gnu.org
2011-05-06 15:21 ` jan.kratochvil at redhat dot com
2011-05-30  8:24 ` jan.kratochvil at redhat dot com
2012-02-08 19:32 ` tromey at redhat dot com

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).