public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: cummings@cacr.caltech.edu
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/5859: gdb fails to break in C++ MPI code
Date: Wed, 06 Mar 2002 19:06:00 -0000	[thread overview]
Message-ID: <20020307030348.10776.qmail@sources.redhat.com> (raw)


>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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2xvYmFsIDw8
IHN0ZDo6ZW5kbDsKICAKICAKICBNUElfRmluYWxpemUoKTsKICByZXR1cm4gMDsKfQo=


             reply	other threads:[~2002-03-07  3:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06 19:06 cummings [this message]
2002-03-15 20:09 rodrigc
2002-03-18 18:10 rodrigc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020307030348.10776.qmail@sources.redhat.com \
    --to=cummings@cacr.caltech.edu \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).