Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: data race in epipecheck() #3860

Closed
dvyukov opened this issue Jul 25, 2012 · 2 comments
Closed

os: data race in epipecheck() #3860

dvyukov opened this issue Jul 25, 2012 · 2 comments

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 25, 2012

When running proprietary code under ThreadSanitizer I see the following reports:

WARNING: DATA RACE at 0x000040115140
Write by goroutine 104:
  os.epipecheck()
      src/pkg/os/file_posix.go:23 +0x135
  os.(*File).Write()
      src/pkg/os/file.go:144 +0xec
  ...
Previous write by goroutine 99:
  os.epipecheck()
      src/pkg/os/file_posix.go:23 +0x135
  os.(*File).Write()
      src/pkg/os/file.go:144 +0xec
  ...

epipecheck() clearly has a data race on file.npipe:

func epipecheck(file *File, e error) {
    if e == syscall.EPIPE {
        file.nepipe++
        if file.nepipe >= 10 {
            sigpipe()
        }
    } else {
        file.nepipe = 0
    }
}
@dvyukov
Copy link
Member Author

dvyukov commented Jul 26, 2012

Comment 1:

Owner changed to @dvyukov.

Status changed to Accepted.

@dvyukov
Copy link
Member Author

dvyukov commented Jul 27, 2012

Comment 2:

This issue was closed by revision ab9cced.

Status changed to Fixed.

dvyukov added a commit that referenced this issue May 11, 2015
««« backport 8b3bf65c620c
os: fix data race in epipecheck()
Fixes #3860.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/6443051

»»»
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants