[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Problems with mod_dav_svn.so on Windows

From: Arild Fines <arild.fines_at_broadpark.no>
Date: 2002-06-21 21:40:53 CEST

Environment: Windows XP Pro, VS.NET Pro(Academic) with debug builds of
Apache 2.0.40 and Subversion ~revision 2300

I am trying to get the Subversion server component working on Windows XP.
However, Apache crashed consistently with a debug assertion when I tried to
check out a repository.
With a little work, I found that the core of the problem was in these lines
in svn_fs__get_node_revision(nodes-table.c in libsvn_fs):

db_err = fs->nodes->get (fs->nodes, trail->db_txn,
                           svn_fs__id_to_dbt (&key, id, trail->pool),
                           svn_fs__result_dbt (&value),
                           0);

svn_fs__track_dbt (&value, trail->pool);

The relevant part of svn_fs_track_dbt(dbt.c) looks like this:

apr_pool_cleanup_register (pool, dbt->data, apr_free_cleanup,
apr_pool_cleanup_null);

This appears to be a Berkeley DB lookup, followed by assigning a clean up
handler to the 'value' returned by BDB. Stepping further in, it seems that
the assigned clean up handler merely calls free on its
argument(value->data). Apache calls all these handlers after the request has
been served by mod_dav_svn.so, and it is inside this particular clean up
handler the assertion is raised.
It seems that even the Debug configuration for the mod_dav_svn VC++ project
links to the import library for libdb40.dll(Release build) instead of the
one for libdb40d.dll(Debug build). I am guessing that this causes
value->data to be allocated by the normal/release version of malloc() inside
the release build of the BDB .dll(looking at BDB source seems to confirm
this), while the clean_up handler calls the debug version of free(), thereby
causing the assertion since they were not allocated from the same heap.
I changed the VC++ project to link against libdb40d.lib instead of
libdb40.lib, and now everything works fine.

Arild Fines

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jun 21 21:41:32 2002

This is an archived mail posted to the Subversion Dev mailing list.