On 8/1/06, Vlad Georgescu <vgeorgescu@gmail.com> wrote:
> On 8/1/06, Branko Čibej <brane@xbc.nu> wrote:
> > Greg Hudson wrote:
> > > On Tue, 2006-08-01 at 00:35 +0200, Branko Čibej wrote:
> > >
> > >>> Personally, I've never done so, I don't know if anyone else does.
> > >>>
> > >> Since we're not actually testing that stuff, and it seems to be a huge
> > >> potential problem, why don't we just disable DSO in 1.4? I think it's a
> > >> misfeature the way it's implemented now, anyway.
> > >>
> > >
> > > It's the only way to create Subversion binary packages which don't
> > > depend on the total set of possible Subversion dependencies.
> > >
> > > dlopen and dlclose do actually refcount libraries, so I believe
> > > --enable-dso works fine in 1.3.
> > >
> > Refcounting isn't the issue. The problem is that APR's pool cleanup code
> > will unload the library when there's still code around that needs it.
> > That probably didn't show up until we had a global cache in the BDB
> > badk-end. Unfortunately, that cache is necessary now.
>
> Why not simply use a finalization function that destroys the cache
> pool when the DSO is unloaded? Something like:
>
> Index: subversion/libsvn_fs_base/bdb/env.c
> ===================================================================
> --- subversion/libsvn_fs_base/bdb/env.c (revision 20924)
> +++ subversion/libsvn_fs_base/bdb/env.c (working copy)
> @@ -448,6 +448,11 @@
> return SVN_NO_ERROR;
> }
>
> +static void __attribute__((destructor)) bdb_fini(void)
> +{
> + if (bdb_cache_pool)
> + svn_pool_destroy(bdb_cache_pool);
> +}
>
> static APR_INLINE void
> acquire_cache_mutex(void)
>
> This only works with gcc, but you could probably use #pragmas with
> other compilers to achieve the same effect.
That's the problem. We work on a huge number of different compilers...
-garrett
Received on Tue Aug 1 20:01:49 2006