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

Tempfile cleanup sloppiness in blame.c

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2004-09-12 23:23:44 CEST

In libsvn_client/blame.c's cleanup_tempfile() we have:

  /* the file may or may not have been closed; try it */
  apr_file_close (file);

If we close a file which we have already closed, the result is a
close(-1), which is not valgrind-clean. Is there any way we can be
more precise? I see no guarantee in apr_file_io.h that it is okay to
close a file twice, and normally it's not kosher to run an object's
destructor more than once. (It would seem like a valid implementation
of the apr_file_io.h interface to allocate each file in a subpool and
destroy the subpool in apr_file_close(), in which case it would
definitely not work right to close files more than once.)

Alternatively, we could modify APR to check if file->filedes is -1
before closing, and document that it's okay to close files twice.

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Sep 12 23:23:58 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.