[MPICH2-dev] mpiexec with gdb

Florin Isaila florin.isaila at gmail.com
Tue Oct 10 16:48:19 CDT 2006


Hi,

I am having a problem running mpiexec with gdb. I set a breakpoint at a
program line, but the program wouldnt stop there in case an error occurs
(o/w it  stops normally).  The error  can be a segmentation fault  or a
call to MPI_Abort.

This makes debugging impossible. Is the old style of starting each mpi
process in a separate debugging session possible? While merging the output
of several debuggers is helpful in some cases, controlling each independent
process is sometimes very important.

Here the simplest example with a forced segmentation fault. The breakpoint
at line 229 is ignored, even though the segmentation fault occurs after. The
gdb is also quited, without making clear the source of error.

stallion:~/tests/mpi/dtype % mpiexec -gdb -n 1 test
0:  (gdb) l 204

0:  204 void test_dt() {
0:  205   int *i = 0;
0:  206   *i = 1;
0:  209}

0:  (gdb) l 227
0:  227 int main(int argc, char* argv[]) {
0:  228   MPI_Init(&argc, &argv);
0:  229   test_dt();
0:  230   MPI_Finalize();
0:  231   return 0;
0:  232 }

0:  (gdb) b 229
0:  Breakpoint 2 at 0x8049f79: file test.c, line 229.
0:  (gdb) r
 rank 0 in job 72  stallion.ece.northwestern.edu_42447   caused collective
abort of all ranks
  exit status of rank 0: killed by signal 9

Many thanks
Florin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/mpich2-dev/attachments/20061010/906420a5/attachment.htm>


More information about the mpich2-dev mailing list