public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace
@ 2013-01-07  1:50 dblaikie at gmail dot com
  2013-01-07 15:32 ` [Bug c++/14999] " tromey at redhat dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dblaikie at gmail dot com @ 2013-01-07  1:50 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 14999
           Summary: Clang debug info crashes GDB when trying to collect
                    local variables in a trace
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dblaikie@gmail.com
    Classification: Unclassified


Using Clang ToT (I believe this would easily reproduce with the recently
released 3.2 as well, perhaps with older versions too) to compile the following
program:

  int func(int p) {
    int x = p + 3;
    return x;
  }

  int main() { return func(3); }

Then loading that into GDB (7.5) & executing the following:

  trace 3
  actions
  collect x
  end

At the "collect" point (reproduces when using "collect q" instead) GDB has the
following error:

  ../../gdb-7.5.x/gdb/tracepoint.c:665: internal-error: expression has min
height < 0
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.

It'd be nice if GDB didn't fail. Beyond that, there's nothing in Clang's debug
info that seems unreasonable for this, but evidently there's /some/ difference
between GCC 4.7 and Clang's output here because GCC's output works just fine.
Perhaps the location information is broken in some way. (advice on that would
be appreciated, though not required - this bug is merely about the internal
error)

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
@ 2013-01-07 15:32 ` tromey at redhat dot com
  2013-01-07 19:36 ` dblaikie at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at redhat dot com @ 2013-01-07 15:32 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2013-01-07 15:32:17 UTC ---
Could you attach the executable?
That would help.

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
  2013-01-07 15:32 ` [Bug c++/14999] " tromey at redhat dot com
@ 2013-01-07 19:36 ` dblaikie at gmail dot com
  2013-01-07 20:29 ` tromey at redhat dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dblaikie at gmail dot com @ 2013-01-07 19:36 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from David Blaikie <dblaikie at gmail dot com> 2013-01-07 19:36:14 UTC ---
Created attachment 6799
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6799
x86 assembly for trace.c from Clang

x86 assembly for trace.c, you can use gcc to assemble this if you like (ie:
Clang is not required):

gcc-4.7 trace.s && gdb a.out < script

(where script is the commands mentioned in the initial bug description)

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
  2013-01-07 15:32 ` [Bug c++/14999] " tromey at redhat dot com
  2013-01-07 19:36 ` dblaikie at gmail dot com
@ 2013-01-07 20:29 ` tromey at redhat dot com
  2013-01-08  3:16 ` dblaikie at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at redhat dot com @ 2013-01-07 20:29 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware    |tromey at redhat dot com
                   |dot org                     |

--- Comment #3 from Tom Tromey <tromey at redhat dot com> 2013-01-07 20:29:29 UTC ---
The bug is that we don't require_rvalue after computing the
frame base.
Testing a patch.

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
                   ` (2 preceding siblings ...)
  2013-01-07 20:29 ` tromey at redhat dot com
@ 2013-01-08  3:16 ` dblaikie at gmail dot com
  2013-01-08  4:26 ` tromey at redhat dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dblaikie at gmail dot com @ 2013-01-08  3:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from David Blaikie <dblaikie at gmail dot com> 2013-01-08 03:16:11 UTC ---
Created attachment 6801
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6801
x86 assembly for trace.c from Clang with frame pointers

Since you mentioned something about frames, that reminded me that Clang does
tend to be a bit conservative about frame pointers - so I thought I should
mention/demonstrate (in case it's relevant) that this bug does still reproduce
when I force Clang to emit frame pointers.

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
                   ` (3 preceding siblings ...)
  2013-01-08  3:16 ` dblaikie at gmail dot com
@ 2013-01-08  4:26 ` tromey at redhat dot com
  2013-01-18 18:32 ` cvs-commit at gcc dot gnu.org
  2013-01-18 18:37 ` tromey at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at redhat dot com @ 2013-01-08  4:26 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at redhat dot com> 2013-01-08 04:26:54 UTC ---
(In reply to comment #4)
> Created attachment 6801 [details]
> x86 assembly for trace.c from Clang with frame pointers
> 
> Since you mentioned something about frames, that reminded me that Clang does
> tend to be a bit conservative about frame pointers - so I thought I should
> mention/demonstrate (in case it's relevant) that this bug does still reproduce
> when I force Clang to emit frame pointers.

It isn't about frame pointers but about the DW_AT_frame_base.
GCC usually uses DW_OP_call_frame_cfa.
clang is emitting

    <41>   DW_AT_frame_base  : 1 byte block: 56     (DW_OP_reg6 (rbp))

The DWARF->AX translator was mishandling this -- just an oversight there.
I have a patch, and it works; I just need to turn the .s into
a test case.

-- 
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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
                   ` (4 preceding siblings ...)
  2013-01-08  4:26 ` tromey at redhat dot com
@ 2013-01-18 18:32 ` cvs-commit at gcc dot gnu.org
  2013-01-18 18:37 ` tromey at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-01-18 18:32 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-01-18 18:32:42 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    tromey@sourceware.org    2013-01-18 18:32:35

Modified files:
    gdb            : ChangeLog dwarf2loc.c 
    gdb/testsuite  : ChangeLog 
Added files:
    gdb/testsuite/gdb.dwarf2: trace-crash.S trace-crash.exp 

Log message:
    PR c++/14999:
    * dwarf2loc.c (dwarf2_compile_expr_to_ax) <DW_OP_fbreg>:
    Call require_rvalue.
    gdb/testsuite
    * gdb.dwarf2/trace-crash.s: New file.
    * gdb.dwarf2/trace-crash.exp: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15035&r2=1.15036
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/dwarf2loc.c.diff?cvsroot=src&r1=1.160&r2=1.161
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3518&r2=1.3519
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/trace-crash.S.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.dwarf2/trace-crash.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] 8+ messages in thread

* [Bug c++/14999] Clang debug info crashes GDB when trying to collect local variables in a trace
  2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
                   ` (5 preceding siblings ...)
  2013-01-18 18:32 ` cvs-commit at gcc dot gnu.org
@ 2013-01-18 18:37 ` tromey at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: tromey at redhat dot com @ 2013-01-18 18:37 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |7.6

--- Comment #7 from Tom Tromey <tromey at redhat dot com> 2013-01-18 18:37:33 UTC ---
Fix checked in.

-- 
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] 8+ messages in thread

end of thread, other threads:[~2013-01-18 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07  1:50 [Bug c++/14999] New: Clang debug info crashes GDB when trying to collect local variables in a trace dblaikie at gmail dot com
2013-01-07 15:32 ` [Bug c++/14999] " tromey at redhat dot com
2013-01-07 19:36 ` dblaikie at gmail dot com
2013-01-07 20:29 ` tromey at redhat dot com
2013-01-08  3:16 ` dblaikie at gmail dot com
2013-01-08  4:26 ` tromey at redhat dot com
2013-01-18 18:32 ` cvs-commit at gcc dot gnu.org
2013-01-18 18:37 ` 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).