From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32613 invoked by alias); 22 May 2013 09:00:17 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 32540 invoked by uid 89); 22 May 2013 09:00:10 -0000 X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,RCVD_VIA_APNIC autolearn=ham version=3.3.1 Received: from cnshjsmin03.alcatel-sbell.com.cn (HELO cnshjsmin03.alcatel-sbell.com.cn) (211.144.215.47) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 22 May 2013 09:00:09 +0000 Received: from CNSHJCASHUB02.ad4.ad.alcatel.com (Unknown_Domain [135.251.50.72]) by cnshjsmin03.alcatel-sbell.com.cn (Symantec Messaging Gateway) with SMTP id 77.09.04680.6198C915; Wed, 22 May 2013 17:00:07 +0800 (HKT) Received: from CNSHJMBX01.ad4.ad.alcatel.com ([135.251.50.101]) by CNSHJCASHUB02.ad4.ad.alcatel.com ([135.251.50.72]) with mapi id 14.03.0123.003; Wed, 22 May 2013 17:00:06 +0800 From: XIAO Wei si A To: "gdb@sourceware.org" Subject: RE: GDB step command crashed on non-stop mode Date: Wed, 22 May 2013 09:00:00 -0000 Message-ID: <01E5AB929A54FD488EEFBD6595F260AF380B131E@cnshjmbx01> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-SW-Source: 2013-05/txt/msg00097.txt.bz2 Hello, I am using GDB non-stop mode to debug a multi-thread application. But it al= ways crashed when I use "step" command. I have tried version 7.4/7.5.1/7.6,= there result are same. The issue does not exist if we don't use non-stop m= ode. I have written a small program to test, easy to reproduce each time. The co= de as below: // test.cc=20 #include using namespace std; void fun(string &str1, string &str2) { =A0=A0=A0 str1 +=3D str2; } int main(void) { =A0=A0 string str1 =3D "abc"; =A0=A0 string str2 =3D "def"; =A0=A0 fun(str1,str2); =A0=A0=20 =A0=A0 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 This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.=A0 Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /root/test...done. (gdb) set target-async 1 (gdb) set non-stop on (gdb) break fun=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=20 Breakpoint 1 at 0x4007b4: file test.cc, line 5. (gdb) run=20 Starting program: /root/test=20 Breakpoint 1, fun (str1=3D..., str2=3D...) at test.cc:5 5=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 str1 +=3D str2; (gdb) step 6=A0=A0=A0=A0=A0=A0 } (gdb) step Program received signal SIGSEGV, Segmentation fault. fun (str1=3D, str1@entry=3D,=20 =A0=A0=A0 str2=3D, str2@entry=3D) at test.cc:6 6=A0=A0=A0=A0=A0=A0 } (gdb) Does anyone know the root cause? Thanks in advance, Weisi