Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 2 Nov 2018 11:46:11 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Deadlock when calling fflush/fclose in multiple threads

On Fri, Nov 02, 2018 at 03:37:18PM +0000, John Starks wrote:
> > 
> > I think such an approach is plausible, but involves the kind of
> > complex and error-prone direct use of atomics I'm actively trying to
> > eliminate. The same could be done without low level hacks via clever
> > use of rwlocks or a mutex+condvar pair, but all of these involve
> > namespace-safety issues and a lot more code than should be introduced
> > into minimal static programs using stdio.
> > 
> > For what it's worth, the only consumers of the open file list that can
> > be executed more than once are fflush(NULL), fclose, and __ofl_add
> > (used by fopen, etc.).
> > 
> > Rich
> 
> Yeah, I can see the desire to avoid additional complexity. It would
> be a shame, though, for fopen or fclose of a local file to block
> behind flushing during an fclose of a file on a network file system,
> for example.

Indeed. Actually it seems to be a show-stopping bug, but I have a
better solution. See the other branch of this thread.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.