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 threads/15520] New: GDB step command crashed on non-stop mode


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

             Bug #: 15520
           Summary: GDB step command crashed on non-stop mode
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: critical
          Priority: P2
         Component: threads
        AssignedTo: unassigned@sourceware.org
        ReportedBy: wei_si.a.xiao@alcatel-lucent.com
    Classification: Unclassified


I am using GDB non-stop mode to debug a multi-thread application. But it always
crashed when I use âstepâ command. I have tried version 7.4/7.5.1/7.6, the
result are same. The issue does not exist if we donât use non-stop mode.
I have written a small program to test, easy to reproduce each time. The code
as below:

// test.cc
#include <string>
using namespace std;
void fun(string &str1, string &str2)
{
    str1 += str2;
}

int main(void)
{
   string str1 = "abc";
   string str2 = "def";
   fun(str1,str2);

   return 0;
}


Compile:
g++ -g test.cc -o test


The procedure for reproduce as below:
vm10-0-0-1:/root-# gdb ./test
GNU gdb (GDB) 7.6
Copyright (C) 2013 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 /root/test...done.
(gdb) set target-async 1
(gdb) set non-stop on
(gdb) break fun Breakpoint 1 at 0x4007b4: file test.cc, line 5.
(gdb) run
Starting program: /root/test 

Breakpoint 1, fun (str1=..., str2=...) at test.cc:5
5           str1 += str2;
(gdb) step
6       }
(gdb) step

Program received signal SIGSEGV, Segmentation fault.
fun (str1=<error reading variable: Cannot access memory at address
0xfffffffffffffff8>, str1@entry=<error reading variable: Cannot access memory
at address 0x8>,
    str2=<error reading variable: Cannot access memory at address
0xfffffffffffffff0>, str2@entry=<error reading variable: Cannot access memory
at address 0x8>) at test.cc:6
6       }
(gdb)

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