public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/5859: gdb fails to break in C++ MPI code
@ 2002-03-15 20:09 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-03-15 20:09 UTC (permalink / raw)
  To: cummings, gcc-bugs, gcc-prs, nobody

Synopsis: gdb fails to break in C++ MPI code

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Fri Mar 15 20:09:01 2002
State-Changed-Why:
    You didn't mention what version of gdb you are using.
    You need to upgrade to a current version of gdb
    (version 5.1.1 is a good version), because the C++
    Application Binary Interface (ABI) changed in gcc 3.x,
    requiring changes to gdb.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5859


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libstdc++/5859: gdb fails to break in C++ MPI code
@ 2002-03-18 18:10 rodrigc
  0 siblings, 0 replies; 3+ messages in thread
From: rodrigc @ 2002-03-18 18:10 UTC (permalink / raw)
  To: cummings, gcc-bugs, gcc-prs, nobody

Synopsis: gdb fails to break in C++ MPI code

State-Changed-From-To: feedback->open
State-Changed-By: rodrigc
State-Changed-When: Mon Mar 18 18:09:56 2002
State-Changed-Why:
    You mention that gdb 5.1.1 still fails for you.
    Did you file a bug report with the gdb developers
    (since it is their program which is failing)?
    
    Your example is a bit too involved to reproduce.
    Read: http://gcc.gnu.org/bugs.html and submit
    preprocessed source.
    
    However, I think your best bet is to follow up with
    the gdb people.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5859


^ permalink raw reply	[flat|nested] 3+ messages in thread

* libstdc++/5859: gdb fails to break in C++ MPI code
@ 2002-03-06 19:06 cummings
  0 siblings, 0 replies; 3+ messages in thread
From: cummings @ 2002-03-06 19:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5859
>Category:       libstdc++
>Synopsis:       gdb fails to break in C++ MPI code
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 06 19:06:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Julian Cummings
>Release:        3.0
>Organization:
>Environment:
i686 running Linux 2.4.9-ac9
>Description:
The gdb debugger fails to break on the symbol MPI_Init
in a trivial MPI code written in C++.  The code uses the
mpich package from Argonne National Laboratory and is 
compiled using mpiCC, a script that invokes the g++ compiler
and links with libmpich.a.  The code is executed using 
"mpirun" and the -gdb flag, which causes gdb to set a 
breakpoint at MPI_Init and run the program.  

The problem is triggered by any C++ MPI code that utilizes 
C++ streams, for example, to write something to std::cout.
In this case, the code will run through all of main() and
stop inside the global object destructor phase.  With no
usage of C++ streams, the code halts at MPI_Init as it 
should.  Also, a comparable MPI code written in C functions
properly with gdb.

I am reporting this as a gcc bug because it does not happen
with gcc 2.96.  It seems that something has changed with
respect to the C++ standard library and streams that makes
debugging of MPI codes with gdb no longer possible.  
>How-To-Repeat:
You will need to have a recent version of mpich
installed (http://www.mcs.anl.gov/mpi/mpich).  I am using 
mpich-1.2.1.  With this installed, build my example code
with the command "mpiCC -g -o cctest main.cc".  Then run it
on a single processor, for example, with the command
"mpirun -np 1 ./cctest".  Now try to run it under the gdb
debugger by adding the flag -gdb to the mpirun command.
You should see that the code does not break at MPI_Init
as expected.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="main.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="main.cc"

I2luY2x1ZGUgIm1waS5oIgojaW5jbHVkZSA8aW9zdHJlYW0+CgppbnQgbWFpbihpbnQgYXJnYyxj
aGFyICphcmd2W10pIAp7CiAgaW50IG15UElkLCBuUHJvY2Vzc29yczsKICBpbnQgbG9jYWwsIGds
b2JhbDsKICBjaGFyIG5hbWVbODBdOwogIGludCBNaW4sIE1heDsKICBpbnQgYSwgYiwgbG9jYWxT
aXplOwogIGludCBuLCBpOwoKICBNUElfSW5pdCgmYXJnYywgJmFyZ3YpOwogIE1QSV9Db21tX3Jh
bmsoTVBJX0NPTU1fV09STEQsICZteVBJZCk7CiAgTVBJX0NvbW1fc2l6ZShNUElfQ09NTV9XT1JM
RCwgJm5Qcm9jZXNzb3JzKTsKCgoKCiAgc3RkOjpjb3V0IDw8IkhlbGxvIHdvcmxkIGZyb20gcHJv
Y2Vzc29yOiIgPDwgbXlQSWQgPDwgIiBvZiAiIDw8CiAgICAgIG5Qcm9jZXNzb3JzIDw8ICIgcHJv
Y2Vzc29ycyIgPDwgc3RkOjplbmRsOwogIAogIGxvY2FsID0gMDsKCiAgYSA9IDA7IGIgPSAxMDAw
OwogIGxvY2FsU2l6ZSA9IChiLWEpIC8gblByb2Nlc3NvcnM7CgogIE1pbiA9IGEgKyBteVBJZCAq
IGxvY2FsU2l6ZTsKICBNYXggPSBNaW4gKyBsb2NhbFNpemU7CgogIGZvciAoaSA9IE1pbjsgaSA8
IE1heDsgKytpKSB7CgogICAgbG9jYWwgPSBsb2NhbCArIGk7CiAgfQogIAoKCiAgTVBJX0FsbHJl
ZHVjZSgmbG9jYWwsICZnbG9iYWwsIDEsTVBJX0lOVCwgTVBJX1NVTSwgTVBJX0NPTU1fV09STEQp
OwoKICBzdGQ6OmNvdXQgPDwgIkxvY2FsIHZhbHVlIG9uIHByb2Nlc3NvcjogIiA8PCBteVBJZCA8
PCAiID0gIiA8PCBsb2NhbCA8PCAiIGdsb2JhbCB2YWx1ZSA9ICIKCSAgICA8PCAgZ2xvYmFsIDw8
IHN0ZDo6ZW5kbDsKICAKICAKICBNUElfRmluYWxpemUoKTsKICByZXR1cm4gMDsKfQo=


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-19  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-15 20:09 libstdc++/5859: gdb fails to break in C++ MPI code rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2002-03-18 18:10 rodrigc
2002-03-06 19:06 cummings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).