From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12255 invoked by alias); 30 Apr 2014 22:13:47 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 12222 invoked by uid 48); 30 Apr 2014 22:13:46 -0000 From: "jistone at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/16889] New: gdb segfaults when printing ASM SDT arguments Date: Wed, 30 Apr 2014 22:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: 7.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jistone at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q2/txt/msg00154.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16889 Bug ID: 16889 Summary: gdb segfaults when printing ASM SDT arguments Product: gdb Version: 7.6 Status: NEW Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: jistone at redhat dot com CC: sergiodj at redhat dot com Created attachment 7571 --> https://sourceware.org/bugzilla/attachment.cgi?id=7571&action=edit example x86_64 asm source with sdt probes With a program compiled from the attached asm source, gdb is unable to print the arguments, and actually segfaults on the second probe. $ gcc -Wall probe.S -o probe $ eu-readelf -n probe [...] Note section [28] '.note.stapsdt' of 128 bytes at offset 0x1058: Owner Data size Type stapsdt 41 Version: 3 PC: 0x4004f5, Base: 0x400590, Semaphore: 0 Provider: probe, Name: foo, Args: '(%rsp)' stapsdt 43 Version: 3 PC: 0x4004f6, Base: 0x400590, Semaphore: 0 Provider: probe, Name: bar, Args: '-8(%rbp)' $ gdb ./probe [...] (gdb) b -p foo Breakpoint 1 at 0x4004f5 (gdb) b -p bar Breakpoint 2 at 0x4004f6 (gdb) r Starting program: /home/jistone/test/probe Breakpoint 1, 0x00000000004004f5 in main () (gdb) p $_probe_arg0 Invalid probe argument 0 -- probe has 0 arguments available (gdb) c Continuing. Breakpoint 2, 0x00000000004004f6 in main () (gdb) p $_probe_arg0 Segmentation fault So probe 'foo' can't find the (%rsp) argument, but probe 'bar' just crashes. If I add the optional N@ size, so they are "8@(%rsp)" and "8@-8(%rbp)", then they are both fine. I'm using gdb-7.6.50.20130731-19.fc20.x86_64 -- You are receiving this mail because: You are on the CC list for the bug.