Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 7604003: Fix race condition in concurrent printf and fopen. (Closed)

Created:
9 years, 4 months ago by pasko-google - do not use
Modified:
9 years, 4 months ago
Reviewers:
Roland McGrath
CC:
native-client-reviews_googlegroups.com
Base URL:
http://git.chromium.org/native_client/nacl-newlib.git@master
Visibility:
Public.

Description

Fix race condition in concurrent printf and fopen. Fixes a race condition reported by ThreadSanitizer that happens when fopen() and printf() are invoked concurrently. fopen() would traverse the list of all open files and check their _flags for non-zero (in __sfp()), while printf would attempt to modify the flags for _stdout via ORIENT(fp, -1) in vfprintf.c:679. BUG=none, but related to http://code.google.com/p/nativeclient/issues/detail?id=870 TEST=./scons irt=0 platform=x86-64 run_newlib_stdio_test --verbose buildbot=tsan with patch: http://codereview.chromium.org/3298014 (the fix does not remove the race reports completely, there is a remaining race on errno) Committed: http://git.chromium.org/gitweb?p=native_client/nacl-newlib.git;a=commit;h=f5185a5

Patch Set 1 #

Patch Set 2 : emailing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -2 lines) Patch
M newlib/libc/stdio/findfp.c View 2 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
pasko-google - do not use
9 years, 4 months ago (2011-08-09 18:20:25 UTC) #1
Roland McGrath
I think that's actually a false race report. Simultaneous access to the word will never ...
9 years, 4 months ago (2011-08-09 18:28:39 UTC) #2
pasko-google - do not use
On 2011/08/09 18:28:39, Roland McGrath wrote: > I think that's actually a false race report. ...
9 years, 4 months ago (2011-08-09 19:06:18 UTC) #3
pasko-google - do not use
On 2011/08/09 19:06:18, pasko wrote: > On 2011/08/09 18:28:39, Roland McGrath wrote: > > I ...
9 years, 4 months ago (2011-08-09 20:46:48 UTC) #4
Roland McGrath
Adding unnecessary synchronization slows things down. But I don't feel strongly enough to keep arguing. ...
9 years, 4 months ago (2011-08-09 20:57:12 UTC) #5
pasko-google - do not use
9 years, 4 months ago (2011-08-10 13:41:25 UTC) #6
On Wed, Aug 10, 2011 at 12:57 AM,  <mcgrathr@chromium.org> wrote:
> Adding unnecessary synchronization slows things down.
> But I don't feel strongly enough to keep arguing.
> LGTM

thank you for review!


-- 
Egor Pasko

-- 
You received this message because you are subscribed to the Google Groups
"Native-Client-Reviews" group.
To post to this group, send email to native-client-reviews@googlegroups.com.
To unsubscribe from this group, send email to
native-client-reviews+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/native-client-reviews?hl=en.

Powered by Google App Engine
This is Rietveld 408576698