[collectd] segfault in notify_email

Manuel CISSE manuel_cisse at yahoo.fr
Fri Aug 27 09:28:17 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I'm using collectd 4.10.1 (Debian sid stock package) and I'm
experiencing segfaults in notify_email quite a few times a day.

Syslog :
Aug 26 23:03:58 evangeline kernel: [2532564.880645] collectd[7394]:
segfault at 0 ip (null) sp 00007fff6b0d1cb8 error 14 in
collectd[400000+21000]

Backtrace :
#0  0x0000000000000000 in ?? ()
#1  0x00007f81ed721cb2 in do_session (session=0x1a99dc0) at protocol.c:360
#2  0x00007f81ed726404 in smtp_start_session (session=0x1a99dc0) at
smtp-api.c:428
#3  0x00007f81ed92f712 in notify_email_notification (n=<value optimized
out>, user_data=<value optimized out>) at notify_email.c:263
#4  0x000000000040b5f6 in plugin_dispatch_notification
(notif=0x7fff6b0d3230) at plugin.c:1533
#5  0x000000000040fa44 in uc_send_notification (name=0x1aef2c0
"nadia.irken.naken.net/df/df-root") at utils_cache.c:192
#6  0x000000000040fd66 in uc_check_timeout () at utils_cache.c:437
#7  0x000000000040641f in do_loop (argc=<value optimized out>,
argv=<value optimized out>) at collectd.c:336
#8  main (argc=<value optimized out>, argv=<value optimized out>) at
collectd.c:618

It seems that notify_email_notification() is called simultaneously by 2
threads leading to 2 calls to smtp_start_session on the same global var
session causing the crash (Note: my mail server is quite slow to
respond, with a faster mail server it may not happen).

Also, there is another minor bug : if collectd is stopped when a
notification is dispatched, notify_email_shutdown() destroys the session
which is used by notify_email_notification() causing a segfault.

I can provide more information if needed.

- -- 
regards,
Manuel CISSE
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx3aREACgkQOMej/7dX0BBFMACggZMfiVFp0+EfJJZGF8E/p4gC
AIsAn324DfxVBBIYrwWZ8nptM4FggMi8
=NbSp
-----END PGP SIGNATURE-----




More information about the collectd mailing list