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

Data race in go test -race #1898

Closed
tcolgate opened this Issue Aug 16, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@tcolgate
Copy link
Contributor

tcolgate commented Aug 16, 2016

What did you do?

Ran go test -race

What did you expect to see?

clean tests

What did you see instead? Under which circumstances?
`prometheus/promql [ go test -race paa * ]
ERRO[0000] parser panic: runtime error: index out of range
goroutine 15 [running]:
github.com/prometheus/prometheus/promql.(_evaluator).recover(0x0, 0xc42002b750)
/home/tristan/go/src/github.com/prometheus/prometheus/promql/engine.go:567 +0x115
panic(0x946b40, 0xc42000c140)
/usr/local/go/src/runtime/panic.go:458 +0x271
github.com/prometheus/prometheus/promql.TestRecoverEvaluatorRuntime(0xc420190540)
/home/tristan/go/src/github.com/prometheus/prometheus/promql/engine_test.go:200 +0x71
testing.tRunner(0xc420190540, 0xa21358)
/usr/local/go/src/testing/testing.go:610 +0xca
created by testing.(_T).Run
/usr/local/go/src/testing/testing.go:646 +0x530

source=engine.go:569

WARNING: DATA RACE
Read at 0x00c420181670 by goroutine 48:
github.com/prometheus/prometheus/promql.(_lexer).scanNumber()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex.go:809 +0x48
github.com/prometheus/prometheus/promql.lexNumberOrDuration()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex.go:788 +0x53
github.com/prometheus/prometheus/promql.(_lexer).run()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex.go:442 +0x9a

Previous write at 0x00c420181670 by goroutine 42:
github.com/prometheus/prometheus/promql.TestLexer()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex_test.go:442 +0x153
testing.tRunner()
/usr/local/go/src/testing/testing.go:610 +0xc9

Goroutine 48 (running) created at:
github.com/prometheus/prometheus/promql.lex()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex.go:435 +0x120
github.com/prometheus/prometheus/promql.TestLexer()
/home/tristan/go/src/github.com/prometheus/prometheus/promql/lex_test.go:441 +0x139
testing.tRunner()
/usr/local/go/src/testing/testing.go:610 +0xc9

Goroutine 42 (running) created at:
testing.(_T).Run()
/usr/local/go/src/testing/testing.go:646 +0x52f
testing.RunTests.func1()
/usr/local/go/src/testing/testing.go:793 +0xb9
testing.tRunner()
/usr/local/go/src/testing/testing.go:610 +0xc9
testing.RunTests()
/usr/local/go/src/testing/testing.go:799 +0x4b5
testing.(_M).Run()
/usr/local/go/src/testing/testing.go:743 +0x12f
main.main()

github.com/prometheus/prometheus/promql/_test/_testmain.go:96 +0x1b4

ERRO[0000] parser panic: runtime error: index out of range
goroutine 298 [running]:
github.com/prometheus/prometheus/promql.(_parser).recover(0x0, 0xc42002b750)
/home/tristan/go/src/github.com/prometheus/prometheus/promql/parse.go:332 +0x115
panic(0x946b40, 0xc42000c140)
/usr/local/go/src/runtime/panic.go:458 +0x271
github.com/prometheus/prometheus/promql.TestRecoverParserRuntime(0xc4201edc80)
/home/tristan/go/src/github.com/prometheus/prometheus/promql/parse_test.go:1884 +0x71
testing.tRunner(0xc4201edc80, 0xa21370)
/usr/local/go/src/testing/testing.go:610 +0xca
created by testing.(_T).Run
/usr/local/go/src/testing/testing.go:646 +0x530
source=parse.go:334
`
Environment

go 1.7beta1

  • System information:

Linux 4.7.0-rc7-ARCH x86_64

  • Prometheus version:

98c0d33

  • Prometheus configuration file:

n/a (run from go test)

@tcolgate

This comment has been minimized.

Copy link
Contributor Author

tcolgate commented Aug 16, 2016

I've not tried on a more recent go version, or a more recent check out.

@brancz

This comment has been minimized.

Copy link
Member

brancz commented Aug 17, 2016

I tried as well go 1.6.3, seems to be present for more than a year. ( f35382d ) After/before that I fail to run the check.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Aug 29, 2016

Fixed via #1925

@fabxc fabxc closed this Aug 29, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.