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]

c++/2261: Segmentation fault on print


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]