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
go/types: data race in representableConst in Go 1.13 and earlier #36687
Comments
@gopherbot backport please 1.12 1.13 |
Backport issue(s) opened: #36688 (for 1.12), #36689 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
cc @dmitshur |
I can reproduce the data race in package main
import "log"
import "golang.org/x/tools/go/packages"
func main() {
for i := 0; i < 100; i++ {
// Load, parse and type-check the program.
cfg := &packages.Config{Mode: packages.LoadAllSyntax}
pkgs, err := packages.Load(cfg, "std")
if err != nil {
log.Fatalf("failed to load metadata: %v", err)
}
if packages.PrintErrors(pkgs) > 0 {
log.Fatalln("there were errors loading standard library")
}
}
} However, it'd be nice to reduce this snippet to use /cc @rsc and @griesemer who have worked on fixing the related problem in |
A data race in (CC @ianthehat @stamblerre) |
|
The race in go/packages reported in #31749 was fixed at tip, but is still an issue for Go 1.13 and earlier, and is showing up in the go/packages race failure reported in #36605.
That race is caused by a race in go/types which in turn is caused by
go/constant.Float64Val()
callingRat.Float64
in math/big, which has a race reported in #34919 , and subsequently fixed in tip.Fixing this race in go/types on Go 1.13 and earlier requires backporting CL 201205 to those releases. (Alternatively, we could fix the race by adding a workaround in go/constant or go/types, but that would be more work). I'm not sure if fixing this is worth a backport but we might as well have the discussion. If we decide not to go with the backport, we'll have to accept a race in go/packages and disable some of its tests in race mode in Go 1.13 and earlier.
The text was updated successfully, but these errors were encountered: