Hi,
I encountered a SEGV in libslp during exit of an application. It turned out that
the application called SLPDereg() via atexit(). However, libslp itself already
cleaned-up its properties via atexit() as well, causing the SEGV.
The following small patch simply disables libslp's atexit() handler. I don't
believe it is needed anyway, since the used memory will be freed
at application exit automatically.
The patch is against trunk/r1589.
Kind regards,
Roel van de Kraats
--- begin patch ---
Skip cleaning-up via atexit(), since it causes problems with applications that
will try to deregister via atexit() as well.
Roel van de Kraats
diff -ur openslp-2.0.beta1.r1589/libslp/libslp_property.c
openslp-2.0.beta1/libslp/libslp_property.c
--- openslp-2.0.beta1.r1589/libslp/libslp_property.c 2008-03-27
00:27:22.000000000 +0100
+++ openslp-2.0.beta1/libslp/libslp_property.c 2008-06-27 09:02:03.000000000
+0200
@@ -69,7 +69,9 @@
SLPSpinLockAcquire(&s_PropInitLock);
if (!s_PropInited && (rv = SLPPropertyInit(gconffile)) == 0);
{
- atexit(SLPPropertyExit);
+/* Cleaning-up via atexit() will cause problems with applications that will
try to deregister via atexit() as well. */
+/* Since memory will be freed at exit anyway, just skip the clean-up routine.
*/
+/* atexit(SLPPropertyExit); */
s_PropInited = true;
}
SLPSpinLockRelease(&s_PropInitLock);
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Openslp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openslp-devel