[collectd] Segfault with python plugin

Florian Forster octo at verplant.org
Wed May 19 14:04:04 CEST 2010


Hi Giorgio,

On Sat, May 15, 2010 at 05:40:54PM -0400, Giorgio Lansing wrote:
> I'm using collectd-4.10.0 on Ubuntu 9.10 64-bit with python 2.6.4rc2.
> My python plugins seem to be working fine and collect data
> successfully, but when I checked the logs I noticed that segfaults
> were occurring frequently and collectd was restarting every 5 minutes.

this problem is *very hard* to debug without the appropriate debugging
information. To create that, you first need to compile with debugging
symbols enabled ("-g") and ideally with optimization disabled ("-O0").
So the approriate way to run configure would be:

  $ ./configure ... CFLAGS="-g -O0"

Then you need to tell your system to write a "core file" when a program
dies due to a segmentation fault. You can do this with:

  $ ulimit -c unlimited

If this is in effect, the system will write a core dump when the process
dies. The file is called "core" or "core.$PID" and resides in the
"current working directory" of the process, usually /var/lib/collectd.

You then need to point a debugger at the core file, for example the GNU
debugger "gdb":

  $ gdb /usr/sbin/collectd /var/lib/collectd/core

The debugger will open a shell-like interface where you tell it to print
a "stack backtrace" using "bt full":

  (gdb) bt full

The command will print (a lot of) output which will hopefully help us to
solve the problem.

HTH,
—octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100519/e1814c72/attachment.pgp 


More information about the collectd mailing list