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

Re: BDB-4.4 and automatic database recovery

From: Branko Čibej <brane_at_xbc.nu>
Date: 2006-01-14 18:29:41 CET

Philip Martin wrote:
> Philip Martin <philip@codematters.co.uk> writes:
>
>
>> There seems to be a problem with the tracking of the DB_CONFIG file as
>> valgrind reports "invalid file descriptor" on lots of operations,
>> typically:
>>
>> $ valgrind -q subversion/svnlook/.libs/lt-svnlook youngest repo
>> 6
>> ==23849== Warning: invalid file descriptor -1 in syscall close()
>>
>
> What's happening is that create_env() registers cleanup_env() as a
> pool cleanup before the DB_CONFIG file has been opened. Now when the
> file is opened APR itself registers a cleanup to close the file and
> when the pool is destroyed the cleanups run in the reverse order, so
> the apr cleanup closes the file before cleanup_env() runs.
>
> Solutions:
>
> - cleanup_env() doesn't close DB_CONFIG
>
> - cleanup_env() checks the file descriptor before closing DB_CONFIG
>
> - open DB_CONFIG before registering cleanup_env()
>

Ah,. thanks for finding this. I'll certainly use one of these solutions
(I think the first would be easiest, since APR files have their own pool
cleanup anyway).

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jan 14 18:29:46 2006

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