-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/cgo: Add initial NetBSD Thread Sanitizer support #24322
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
Conversation
Recognize NetBSD in: - go/internal/work/init.go - race.bash - runtime/race/race.go Add __ps_strings symbol in runtime/cgo/netbsd.go as this is used internally in the TSan library for NetBSD and used for ReExec(). Tested on NetBSD/amd64 v. 8.99.12. Around 98% tests are passing for the ./race.bash target.
This PR (HEAD: 17f1964) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/#/c/go/+/99835 to see it. Tip: You can toggle comments from me using the |
This PR (HEAD: 1d09248) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/#/c/go/+/99835 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Gerrit Bot: Uploaded patch set 2: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Benny Siegert: Patch Set 2: Code-Review+1 What is the minimum NetBSD version that this needs? Should that be documented somewhere, or perhaps enforced in the script? Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
NetBSD 8.0 or later needed. Older versions might work, but I won't invest into them. 8.0 is already marked as the minimum version recommended for Go. |
CC: @dvyukov
http://netbsd.org/~kamil/llvm/go-tsan-2017-12-06.txt I'm using a locally generated syso file for NetBSD/amd64: http://netbsd.org/~kamil/llvm/race_netbsd_amd64.syso I assume that it has to be added by upstream maintainers. |
There is one failure related to exit status, which is I guess a plain bug somewhere and needs to be fixed. Re syso file, yes, somebody needs to regenerate all of them and add netbsd. |
Few tests are indeed racy. In this case I follow "Pareto principle" and move on upstreaming my local changes, as more than 95% of tests report success. In future I plan to be back to sanitizers in LLVM and correct remaining bugs and enable the execution of regression tests on LLVM/NetBSD buildbot. It will be followed by squashing the Go/TSan bugs. It will be easier to fix the remaining bugs having TSan/NetBSD in the Go sources. |
As you probably saw in llvm tsan tests we use "tsan-invisible-barrier" in tests, which effectively turns them into non-parallel/non-concurrent (though, tsan runtime still thinks that they are parallel and detects races). That eliminates flakiness due to non-determinism and timings. It would be good to have the same for go tests as well. |
I don't have strong opinions, but if we will support it - I will make sure to handle it correctly [in future]. |
Message from Brad Fitzpatrick: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
a8a60ac
to
87412a1
Compare
Updates golang/go#24354. Updates golang/go#19273. Updates golang/go#24322. Change-Id: Ia67fde51d7698ca94d86c4697fd153a551a8ceee Reviewed-on: https://go-review.googlesource.com/112880 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Message from Bryan C. Mills: Patch Set 2: Kamil, do you want to test this against the race_netbsd_amd64.syso file in https://golang.org/cl/112896 before I submit it? Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
I will have a look! |
e4259d6
to
6dbaf03
Compare
Results for:
and a local diff to enable http://netbsd.org/~kamil/golang/golang-amd64-2018-06-03-race-HEAD.txt
|
Tested with:
|
For the record, C/C++ version of TSan (from HEAD of LLVM) for NetBSD/amd64:
|
ping? |
ping |
Message from Gerrit Bot: Uploaded patch set 4: New patch set was added with same tree, parent, and commit message as Patch Set 3. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Gerrit Bot: Uploaded patch set 6: New patch set was added with same tree, parent, and commit message as Patch Set 5. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
(I've used github's online conflict resolver.. hopefully everything is fine). |
Message from Gerrit Bot: Uploaded patch set 8: New patch set was added with same tree, parent, and commit message as Patch Set 7. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
@bsiegert please help to upstream this, thank you in advance! |
Message from Brad Fitzpatrick: Patch Set 8: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Gobot Gobot: Patch Set 8: TryBots beginning. Status page: https://farmer.golang.org/try?commit=baca594a Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Gobot Gobot: Patch Set 8: TryBot-Result-1 1 of 19 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Message from Brad Fitzpatrick: Patch Set 9: Commit message was updated. Please don’t reply on this GitHub thread. Visit golang.org/cl/99835. |
Recognize NetBSD in: - go/internal/work/init.go - race.bash - runtime/race/race.go Add __ps_strings symbol in runtime/cgo/netbsd.go as this is used internally in the TSan library for NetBSD and used for ReExec(). Tested on NetBSD/amd64 v. 8.99.12. Around 98% tests are passing for the ./race.bash target. Updates #19273 Change-Id: Ic0e48d2fb159a7868aab5e17156eeaca1225e513 GitHub-Last-Rev: d6e0827 GitHub-Pull-Request: #24322 Reviewed-on: https://go-review.googlesource.com/99835 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This PR is being closed because golang.org/cl/99835 has been merged. |
Recognize NetBSD in:
Add __ps_strings symbol in runtime/cgo/netbsd.go as this is
used internally in the TSan library for NetBSD and used for
ReExec().
Tested on NetBSD/amd64 v. 8.99.12.
Around 98% tests are passing for the ./race.bash target.