On 07/24/2008 08:13 PM, Nick Wagner wrote: > By which I mean having a LIBSLPPropertyCleanup() that checks > s_PropInited and does the SLPSpinLockAcquire on the s_PropInitLock > before calling SLPPropertyExit. Sounds good. Please have a look at rev 1595 for my implementation (I was the one who removed the old clean-up functionality, so I'm the one to get it working again ;-)
Roel > > --Nick > > On Thu, Jul 24, 2008 at 1:10 PM, Nick Wagner <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > What if we call SLPPropertyExit as part of the cleanup in > libslp_handle:ExitUserAgentLibrary? > > > On Mon, Jun 30, 2008 at 8:07 AM, Roel van de Kraats > <[EMAIL PROTECTED]> wrote: > > 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 > Openslp-devel@lists.sourceforge.net > <mailto:Openslp-devel@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/openslp-devel > > > ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Openslp-devel mailing list Openslp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openslp-devel