-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/race: FATAL: ThreadSanitizer CHECK failed: ./gotsan.cc on go1.12beta1/tip #29329
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
Comments
CC @dvyukov |
This appears to be due to an assertion failure in CHECK_EQ(kBlockMagic, ((u64*)addr)[0]); That suggests that memory corruption is occurring somewhere. |
Actually this appears to be a compiler error. It is compiling a method such that it calls |
CC @randall77 Here is a standalone reproducer. It doesn't crash in the same way, but it does crash with tip. With 1.11 it succeeds. The bug is that package main
import (
"fmt"
)
type LineString []Point
type Point [2]float64
//go:noinline
func benchmarkData() LineString {
return LineString{{1.0, 2.0}}
}
func (ls LineString) Clone() LineString {
ps := MultiPoint(ls)
return LineString(ps.Clone())
}
type MultiPoint []Point
func (mp MultiPoint) Clone() MultiPoint {
if mp == nil {
return nil
}
points := make([]Point, len(mp))
copy(points, mp)
return MultiPoint(points)
}
func F1() {
cases := []struct {
threshold float64
length int
}{
{0.1, 1118},
{0.5, 257},
{1.0, 144},
{1.5, 95},
{2.0, 71},
{3.0, 46},
{4.0, 39},
{5.0, 33},
}
ls := benchmarkData()
for k := 0; k < 100; k++ {
for i, tc := range cases {
r := DouglasPeucker(tc.threshold).LineString(ls.Clone())
if len(r) == tc.length {
fmt.Printf("%d: unexpected\n", i)
}
}
}
}
// A DouglasPeuckerSimplifier wraps the DouglasPeucker function.
type DouglasPeuckerSimplifier struct {
Threshold float64
}
// DouglasPeucker creates a new DouglasPeuckerSimplifier.
func DouglasPeucker(threshold float64) *DouglasPeuckerSimplifier {
return &DouglasPeuckerSimplifier{
Threshold: threshold,
}
}
func (s *DouglasPeuckerSimplifier) LineString(ls LineString) LineString {
return lineString(s, ls)
}
type simplifier interface {
simplify(LineString, bool) (LineString, []int)
}
func lineString(s simplifier, ls LineString) LineString {
return runSimplify(s, ls)
}
func runSimplify(s simplifier, ls LineString) LineString {
if len(ls) <= 2 {
return ls
}
ls, _ = s.simplify(ls, false)
return ls
}
func (s *DouglasPeuckerSimplifier) simplify(ls LineString, wim bool) (LineString, []int) {
return nil, nil
}
func main() {
F1()
} |
Change https://golang.org/cl/155917 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I have reproduced on "tip" on travis-ci (1, 2, 3) and locally (osx) using go1.12beta1 installed via gvm
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
gvm install go1.12beta1
gvm use go1.12beta1
go get github.com/paulmach/orb
cd $GOPATH/src/github.com/paulmach/orb/simplify
go test -race -v .
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: