FAQ
Sorry this took three months to be reviewed. Please <ping /> in the
future.


https://codereview.appspot.com/6553059/diff/15003/src/pkg/exp/inotify/inotify_linux.go
File src/pkg/exp/inotify/inotify_linux.go (right):

https://codereview.appspot.com/6553059/diff/15003/src/pkg/exp/inotify/inotify_linux.go#newcode87
src/pkg/exp/inotify/inotify_linux.go:87: if len(w.watches) == 0 {
This is racy, do you need to hold w.mu ? even then, you can race after
w.mu is unlocked to call w.AddWatch

https://codereview.appspot.com/6553059/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dave at Feb 16, 2013 at 2:45 am
    ==================
    WARNING: DATA RACE
    Read by goroutine 11:
    runtime.mapaccess2()
    /home/dfc/go/src/pkg/runtime/hashmap.c:944 +0x0
    exp/inotify.(*Watcher).RemoveWatch()
    /home/dfc/go/src/pkg/exp/inotify/inotify_linux.go:142 +0x7d
    exp/inotify.TestInotifyIgnored()
    /home/dfc/go/src/pkg/exp/inotify/inotify_linux_test.go:140 +0x4fe
    testing.tRunner()
    /home/dfc/go/src/pkg/testing/testing.go:315 +0xe8

    Previous write by goroutine 12:
    runtime.mapdelete()
    /home/dfc/go/src/pkg/runtime/hashmap.c:1063 +0x0
    exp/inotify.(*Watcher).readEvents()
    /home/dfc/go/src/pkg/exp/inotify/inotify_linux.go:207 +0x5de

    Goroutine 11 (running) created at:
    testing.RunTests()
    /home/dfc/go/src/pkg/testing/testing.go:430 +0xc7a
    testing.Main()
    /home/dfc/go/src/pkg/testing/testing.go:327 +0xcd
    main.main()
    exp/inotify/_test/_testmain.go:47 +0xda
    runtime.main()
    /home/dfc/go/src/pkg/runtime/proc.c:253 +0x8e

    Goroutine 12 (running) created at:
    exp/inotify.NewWatcher()
    /home/dfc/go/src/pkg/exp/inotify/inotify_linux.go:76 +0x332
    exp/inotify.TestInotifyIgnored()
    /home/dfc/go/src/pkg/exp/inotify/inotify_linux_test.go:109 +0x76
    testing.tRunner()
    /home/dfc/go/src/pkg/testing/testing.go:315 +0xe8

    ==================
    PASS
    Found 1 data race(s)
    FAIL exp/inotify 2.074s


    https://codereview.appspot.com/6553059/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mbnull Org at Feb 16, 2013 at 11:56 am
    i pointed out the data race in the discussion mail 5 month ago. it was
    not introduced by me. it only started to show because RemoveWatch is now
    called by the test.

    in this path i also put the isClosed check inside the lock. i think we
    should not expect the user to call AddWatch and Close from the same go
    routine.

    https://codereview.appspot.com/6553059/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedFeb 16, '13 at 2:41a
activeFeb 16, '13 at 11:56a
posts3
users2
websitegolang.org

2 users in discussion

Dave: 2 posts Mbnull Org: 1 post

People

Translate

site design / logo © 2022 Grokbase