[petsc-users] Attaching to gdb within screen

Jed Brown jed at 59A2.org
Wed Jun 22 08:09:01 CDT 2011


On Wed, Jun 22, 2011 at 14:59, John Fettig <john.fettig at gmail.com> wrote:

> On Wed, Jun 22, 2011 at 8:53 AM, Jed Brown <jed at 59a2.org> wrote:
> > On Wed, Jun 22, 2011 at 14:43, John Fettig <john.fettig at gmail.com>
> wrote:
> >>
> >> I'm using mpich2-1.3.2p1 My screen version (which is hopefully not
> >> important) is  4.00.03.
> >
> > Interesting. Which operating system? When some processes attach
> > successfully, what does the backtrace from gdb look like?
>
> I'm using CentOS 5.6.  Here's the backtrace from -np 2 (where only one
> gdb is launched):
>
> #0  0x000000310ee9a510 in __nanosleep_nocancel () from /lib64/libc.so.6
> #1  0x000000310ee9a364 in sleep () from /lib64/libc.so.6
> #2  0x00002b37a6601a83 in PetscSleep (s=10) at psleep.c:56
> #3  0x00002b37a5ef049b in PetscAttachDebugger () at adebug.c:410
> #4  0x00002b37a6302351 in PetscOptionsCheckInitial_Private () at init.c:392
> #5  0x00002b37a65cdeb6 in PetscInitialize (argc=0x7fff636a6d3c,
> args=0x7fff636a6d30, file=0x0, help=0x9f3d4d "") at pinit.c:639
> #6  0x0000000000409ac4 in main (argc=2, argv=0x7fff636a6ee8) at main.c:694


Okay, this is the right place. Can you do a couple experiments:

$ cat > redirect.sh
#!/bin/sh

echo ppid=$PPID pwd=$PWD cmd="$@"
sleep 10
exec "$@"
$ chmod +x redirect.sh

Then show me the output of:

$ mpiexec -n 2 .... -debug_terminal "redirect.sh echo"

and

$ mpiexec -n 2 .... -debug_terminal "screen -X -S debug screen redirect.sh"

You should be able to see some output in the screen session before gdb is
invoked.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110622/c6ba5c88/attachment-0001.htm>


More information about the petsc-users mailing list