This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
c++/2261: Segmentation fault on print
- From: tonne2005 at gehheimdienst dot de
- To: gdb-gnats at sources dot redhat dot com
- Date: 14 May 2007 12:52:43 -0000
- Subject: c++/2261: Segmentation fault on print
- Reply-to: tonne2005 at gehheimdienst dot de
>Number: 2261
>Category: c++
>Synopsis: Segmentation fault on print
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon May 14 12:58:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: Frank Schmitt
>Release: 6.5-15.fc6rh
>Organization:
>Environment:
Fedora Core 6
>Description:
gdb crashes when trying to assign a value to a C++-string in a print statement
>How-To-Repeat:
Compile the following program with g++ 4.1.1
(g++ -o foo -g foo.cpp)
-----------------------------------------------
#include <iostream>
#include <string>
int main(int argv, char* argc[]){
std::string s="foo";
std::cout << s << std::endl;
return 0;
}
-----------------------------------------------
start gdb, run the program in it, set a breakpoint in the std::cout line and when execution reaches the breakpoint say
p s="bar"
for me gdb segfaults reliable in this situation.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: