Re: open() and cancellation - #123472



On Thu, 2005-08-04 at 14:16 +0200, Frederic Crozat wrote:
> Le lundi 01 ao�05 �8:33 -0500, Federico Mena Quintero a �it :
> > Hi,
> > 
> > Bug #123472 has been biting us here at Novell because people mount
> > netware filesystems (!) and Nautilus leaks file handles.  It does this
> > while opening and reading text files to generate icons for them.
> > 
> > I just submitted a patch to bugzilla.  It patches file-method.c.
> > 
> > Although the bug report mentions that handles may be leaked for any
> > method which does not handle cancellation on its own, I think
> > file-method is by far the most important.
> > 
> > Does the patch seem reasonable?  It certainly fixes the problem with
> > text files for me.
> 
> This patch should be sent to gnome-vfs mailing list, I think :)
> 
> BTW, it looks fine for me, I've just added it to Mandriva gnome-vfs2
> package :)

It turns out that the patch is too na� :(

Reload bug #123472 and you'll see some info.  I hadn't understood Dave
and Alex's comments, but now I do.  Basically, you can also get canceled
after open(2) returns, and the code doesn't handle that.

I'm extracting some interesting debug logs after adding a bunch of
printf()s, so I think I'll have it fixed soon.

Now I delay the closing of canceled open()s until we are back in the
dispatch_job_callback() for the main thread, since that is the only
place where it can be done without race conditions.

However, with my new patch the code accesses a structure that has
already been freed - I'm investigating that.

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]