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