DescriptionRevert "Fix race condition in concurrent printf and fopen."
This reverts commit a46dfff66f8c8f13a7be3b78bd4c81ba0b94ccb0
since it introduced a possible deadlock between two threads
calling fopen() and fclose(). See: http://codereview.chromium.org/7604003
fclose() takes two locks using _flockfile() and then later
on __sfp_lock_acquire(). __sfp previously only took one
lock using __sfp_lock_acquire but this change added an inner
call to _flockfile() which causes deadlock.
Although accessing the fp->flags in __sfp to check it
against zero is technically a data race with any function
that writes to it, this seems to be by design here.
Specifically, AFAICT, the race with printf() can't change
the outcome of the zero test since flags is guarantees to
be non-zero both before and after the call or ORIENT().
So my conclusion is that tsan found a false positive here.
BUG=338220
R=mcgrathr@chromium.org
Committed: https://git.chromium.org/gitweb?p=native_client/nacl-newlib.git;a=commit;h=d28ae86
Committed: https://git.chromium.org/gitweb?p=native_client/nacl-newlib.git;a=commit;h=41e7008
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|