[PD] how to debug?

Mathieu Bouchard matju at sympatico.ca
Thu Oct 24 02:43:12 CEST 2002

On Thu, 24 Oct 2002, Smoerk wrote:

> my pd (0.35 / linux) crashes or freezes sometimes. Propably it is one of
> the externals I compiled, but I cannot figure out which one. Is there
> some possibility to compile pd and the externals with debug options or
> get traceback or some message why it crashes?

1. Signal handlers must be set correctly. jMax and PureData trap a lot of
signals for their own reasons... GridFlow removes all relevant signals
handlers so that Linux's builtin handler fires up with the regular
message. This is because i have to debug things sometimes. This is done
from within C using the signal() function found in <signal.h>.

2. When Linux's handler is enabled, then there is a commandline option
telling whether a memory dump should be made or not. try "ulimit -c
unlimited". it will be stored in a file called "core".

3. fire up gdb. you have to tell it the name of the program that caused
the error, because somehow gdb can't figure it from the "core" file. you
also have to give the core name to gdb (although it's always "core").

4. important gdb commands: "q" to quit, and "bt" to give the stack listing
(the list of active functions with their parameters)

5. if you don't see the functions names then you will have to add "-g" in
the gcc options somewhere, and recompile. this is on a program-by-program
basis (or library-by-library).


More information about the Pd-list mailing list