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

Re: Error leak in libsvn_fs_base/bdb/env.c

From: Branko ─îibej <brane_at_xbc.nu>
Date: 2007-01-11 12:17:01 CET

Vlad Georgescu wrote:
> bdb_close() in libsvn_fs_base/bdb/env.c currently leaks the pending
> errors from BDB if it runs into a DB_RECOVERY error while closing
> the database (it ignores the DB_RECOVERY error, but forgets to clear
> the list of errors from the error_info structure). The following patch
> solves this problem, but I'm not familiar with that code so I thought
> I'd run this by the list:
>
> Index: subversion/libsvn_fs_base/bdb/env.c
> ===================================================================
> --- subversion/libsvn_fs_base/bdb/env.c (revision 22952)
> +++ subversion/libsvn_fs_base/bdb/env.c (working copy)
> @@ -492,6 +492,11 @@
> errors, since they're dealt with eventually by BDB itself. */
> if (db_err && (!SVN_BDB_AUTO_RECOVER || db_err != DB_RUNRECOVERY))
> err = convert_bdb_error(bdb, db_err);
> + else
> + {
> + bdb_error_info_t *error_info = get_error_info(bdb);
> + svn_error_clear(error_info->pending_errors);
> + }
>
> /* Free the environment descriptor. The pool cleanup will do this unless
> the cache has already been destroyed. */
>

Looks O.K. ... but I'd be careful here. It's been a while since I wrote
that code, but I do recall strange things happening if I wasn't careful
about the pending errors list.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Jan 11 12:18:10 2007

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