Ask Your Question

What's the easiest/best way to debug remote processes?

asked 2012-04-20 10:57:22 -0500

updated 2012-04-20 10:58:42 -0500

Using roslaunch to launch remote processes presents a bit of a challenge in debugging. Typically I use ulimit -c unlimited to cause any crash to emit a stack trace, however it seems as though roslaunch is not running a bash shell that executes .bashrc as no cores are being dumped. The alternative has been launch-prefix with xterm and gdb but obviously that won't work in this situation.

What are some ways to debug remote processes (especially ones that crash before gdb --attach can be called)?

(I'm running electric so env-loader is unavailable)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-04-24 06:46:49 -0500

I ended up using the info on this page:

to set up gnuscreen in my launch file with:

launch-prefix="screen -d -m gdb --args"

And then ssh'd over to the other machine and did

screen -r
edit flag offensive delete link more

answered 2012-04-22 08:21:06 -0500

Lorenz gravatar image

If log files are not sufficient for you, you could use a proxy script that sets uname and then executes your node. It feels like an ugly hack but should work :) Such a script could look like this (untested!):

uname -c unlimited

When you use the script as a launch-prefix, you should get core dumps.

edit flag offensive delete link more

answered 2012-04-21 21:08:36 -0500

ahendrix gravatar image

If I remember properly, a remote shell (usually bash) does get invoked before roslaunch is invoked. On some modern linux systems, particularly Ubuntu, there's a check at the beginning of the default .bashrc that exits if you're running a non-interactive shell. You should look for that and put your ulimit before it.

edit flag offensive delete link more


Actually, I doubt that .bashrc is loaded on remote launch. bash's man page states that .bashrc is only loaded for interactive shells. By setting the environment variable BASH_ENV using the env tag in roslaunch, it should be possible to achieve loading bashrc though.

Lorenz gravatar image Lorenz  ( 2012-04-22 08:16:43 -0500 )edit

I wasn't able to test this since I fixed the bug causing the crash, but I did verify that .bashrc has the line in question.

Asomerville gravatar image Asomerville  ( 2012-04-24 06:48:15 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-04-20 10:57:22 -0500

Seen: 1,164 times

Last updated: Apr 24 '12