Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2169)

Issue 103300045: code review 103300045: fsnotify: fix data race on kevent buffer.

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by tilaks
Modified:
9 years, 4 months ago
Reviewers:
nathany
CC:
golang-codereviews, nathany
Visibility:
Public.

Description

fsnotify: fix data race on kevent buffer. In the BSD implementation of fsnotify, the watcher's kbuf buffers a kevent between syscall.SetKevent (which prepares the kevent) and syscall.Kevent (which registers the kevent). The implementation intends to protect access to kbuf, but fails to do so in addWatch and removeWatch. This change fixes the data race by allocating a new kevent buffer for every method invocation. Run the following command (as suggested by nathany) to test the change on OS X: go test -test.run=TestConcurrentRemovalOfWatch -test.cpu=1,1,1,1,1 -race

Patch Set 1 #

Patch Set 2 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Patch Set 3 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Patch Set 4 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Patch Set 5 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Patch Set 6 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Patch Set 7 : diff -r 19114a3ee7d5 https://code.google.com/p/go.exp/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -13 lines) Patch
M fsnotify/fsnotify_bsd.go View 1 3 chunks +9 lines, -13 lines 0 comments Download
A fsnotify/fsnotify_test_darwin.go View 1 2 3 4 5 6 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 13
tilaks
Hello golang-dev@googlegroups.com (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.exp/
9 years, 10 months ago (2014-06-11 20:22:59 UTC) #1
gobot
Replacing golang-dev with golang-codereviews. To the author of this CL: If you are using 'hg ...
9 years, 10 months ago (2014-06-11 20:24:43 UTC) #2
nathany
On 2014/06/11 20:24:43, gobot wrote: > Replacing golang-dev with golang-codereviews. > > To the author ...
9 years, 10 months ago (2014-06-13 03:02:50 UTC) #3
tilaks
Hello golang-codereviews@googlegroups.com, nj@nathany.com (cc: golang-codereviews@googlegroups.com), Please take another look.
9 years, 10 months ago (2014-06-13 06:47:04 UTC) #4
nathany
On 2014/06/13 06:47:04, tilaks wrote: > Hello mailto:golang-codereviews@googlegroups.com, mailto:nj@nathany.com (cc: > mailto:golang-codereviews@googlegroups.com), > > Please ...
9 years, 10 months ago (2014-06-20 02:25:41 UTC) #5
tilaks
On 2014/06/20 02:25:41, nathany wrote: > On 2014/06/13 06:47:04, tilaks wrote: > > Hello mailto:golang-codereviews@googlegroups.com, ...
9 years, 10 months ago (2014-06-20 23:18:15 UTC) #6
nathany
I don't know a better way either. Are you testing on BSD or OS X ...
9 years, 10 months ago (2014-06-20 23:25:00 UTC) #7
nathany
Running the test several times on OS X 10.9.3 does result in a data race ...
9 years, 10 months ago (2014-06-22 05:21:48 UTC) #8
tilaks
Thanks for taking the time to verify this test. I've made the changes you suggested; ...
9 years, 10 months ago (2014-06-23 18:59:10 UTC) #9
nathany
It looks like your file needs to be named fsnotify_darwin_test.go, otherwise that test doesn't run ...
9 years, 10 months ago (2014-06-28 19:55:45 UTC) #10
nathany
On 2014/06/28 19:55:45, nathany wrote: > It looks like your file needs to be named ...
9 years, 8 months ago (2014-08-18 04:12:16 UTC) #11
nathany
> tilaks. just for your information, I long ago merged this change at > https://github.com/go-fsnotify/fsnotify ...
9 years, 8 months ago (2014-08-18 05:42:16 UTC) #12
gobot
9 years, 4 months ago (2014-12-19 05:08:16 UTC) #13
R=close

To the author of this CL:

The Go project has moved to Gerrit Code Review.

If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.

If there has been discussion on this CL, please give a link to it
(golang.org/cl/103300045 is best) in the description in your
new CL.

Thanks very much.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b