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

Flaky "invalid memory address or nil pointer" error in rules package's tests #4477

Closed
simonpasquier opened this Issue Aug 7, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@simonpasquier
Copy link
Member

simonpasquier commented Aug 7, 2018

Spotted in https://travis-ci.org/prometheus/prometheus/builds/413101424

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa684b0]
goroutine 111 [running]:
github.com/prometheus/prometheus/rules.(*RecordingRule).Eval(0xc420185880, 0xc17a20, 0xc4203e0000, 0x270c56ef, 0xed2fb8ea0, 0xee04e0, 0x0, 0x0, 0xee04e0, 0xc17a20, ...)
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/recording.go:73 +0xf0
github.com/prometheus/prometheus/rules.(*Group).Eval.func1(0xc179a0, 0xc4200a6050, 0x270c56ef, 0xed2fb8ea0, 0xee04e0, 0xc4200e2500, 0x0, 0xc1b4e0, 0xc420185880)
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:384 +0x2ec
github.com/prometheus/prometheus/rules.(*Group).Eval(0xc4200e2500, 0xc179a0, 0xc4200a6050, 0x270c56ef, 0xed2fb8ea0, 0xee04e0)
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:452 +0xd0
github.com/prometheus/prometheus/rules.(*Group).run.func1()
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:230 +0x105
github.com/prometheus/prometheus/rules.(*Group).run(0xc4200e2500, 0xc179a0, 0xc4200a6050)
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:243 +0x38f
github.com/prometheus/prometheus/rules.(*Manager).Update.func1.1(0xc4201c4140, 0xc4200e2500)
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:679 +0xa7
created by github.com/prometheus/prometheus/rules.(*Manager).Update.func1
	/home/travis/gopath/src/github.com/prometheus/prometheus/rules/manager.go:674 +0x64
FAIL	github.com/prometheus/prometheus/rules	0.430s
@jojohappy

This comment has been minimized.

Copy link
Contributor

jojohappy commented Aug 8, 2018

I can not reproduce this test failed and the link seems to be passed. I would love to fix this bug.

@simonpasquier

This comment has been minimized.

Copy link
Member Author

simonpasquier commented Aug 9, 2018

@jojohappy right the failed build log has been overwritten. I don't know how to reproduce it unfortunately.

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Aug 17, 2018

To reproduce, run it enough times and grab popcorn :)

➜  prometheus git:(master) for i in {1..5000}
do
   go test ./rules -count=1
done
ok  	github.com/prometheus/prometheus/rules	0.122s
ok  	github.com/prometheus/prometheus/rules	0.127s
ok  	github.com/prometheus/prometheus/rules	0.132s
ok  	github.com/prometheus/prometheus/rules	0.130s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1426c3a]

goroutine 189 [running]:
github.com/prometheus/prometheus/rules.(*RecordingRule).Eval(0xc4201a64d0, 0x15ab2e0, 0xc420a667b0, 0x270c56ef, 0xed308ca2a, 0x1814b20, 0x0, 0x0, 0x1814b20, 0x15ab2e0, ...)
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/recording.go:73 +0xca
github.com/prometheus/prometheus/rules.(*Group).Eval.func1(0x15ab260, 0xc4200ac048, 0x270c56ef, 0xed308ca2a, 0x1814b20, 0xc4200eeb40, 0x0, 0x15aebe0, 0xc4201a64d0)
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:384 +0x26f
github.com/prometheus/prometheus/rules.(*Group).Eval(0xc4200eeb40, 0x15ab260, 0xc4200ac048, 0x270c56ef, 0xed308ca2a, 0x1814b20)
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:452 +0xad
github.com/prometheus/prometheus/rules.(*Group).run.func1()
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:230 +0xc0
github.com/prometheus/prometheus/rules.(*Group).run(0xc4200eeb40, 0x15ab260, 0xc4200ac048)
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:243 +0x288
github.com/prometheus/prometheus/rules.(*Manager).Update.func1.1(0xc4200baeb0, 0xc4200eeb40)
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:679 +0x60
created by github.com/prometheus/prometheus/rules.(*Manager).Update.func1
	/Users/goutham/go/src/github.com/prometheus/prometheus/rules/manager.go:674 +0x56
FAIL	github.com/prometheus/prometheus/rules	0.115s
@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 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 22, 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.