proc_test: TestStacktraceWithBarriers failing on go1.8 (#735)
Changes to the GC in 1.8 make this test fail because the GC isn't inserting stack barriers into our test program anymore. This isn't the same thing as being unable to print stacktraces in presence of stack barriers so the test shouldn't fail.
This commit is contained in:
parent
dd3cc63d8f
commit
b9bdf597b0
@ -2436,13 +2436,27 @@ func TestStacktraceWithBarriers(t *testing.T) {
|
|||||||
// stack frame with the address of runtime.stackBarrier.
|
// stack frame with the address of runtime.stackBarrier.
|
||||||
// The original return address is saved into the stkbar slice inside the G
|
// The original return address is saved into the stkbar slice inside the G
|
||||||
// struct.
|
// struct.
|
||||||
|
|
||||||
|
// In Go 1.8 stack barriers are not inserted by default, this enables them.
|
||||||
|
godebugOld := os.Getenv("GODEBUG")
|
||||||
|
defer os.Setenv("GODEBUG", godebugOld)
|
||||||
|
os.Setenv("GODEBUG", "gcrescanstacks=1")
|
||||||
|
|
||||||
|
// TODO(aarzilli): in Go 1.9 stack barriers will be removed completely, therefore
|
||||||
|
// this test will have to be disabled
|
||||||
|
|
||||||
withTestProcess("binarytrees", t, func(p *Process, fixture protest.Fixture) {
|
withTestProcess("binarytrees", t, func(p *Process, fixture protest.Fixture) {
|
||||||
// We want to get a user goroutine with a stack barrier, to get that we execute the program until runtime.gcInstallStackBarrier is executed AND the goroutine it was executed onto contains a call to main.bottomUpTree
|
// We want to get a user goroutine with a stack barrier, to get that we execute the program until runtime.gcInstallStackBarrier is executed AND the goroutine it was executed onto contains a call to main.bottomUpTree
|
||||||
_, err := setFunctionBreakpoint(p, "runtime.gcInstallStackBarrier")
|
_, err := setFunctionBreakpoint(p, "runtime.gcInstallStackBarrier")
|
||||||
assertNoError(err, t, "setFunctionBreakpoint()")
|
assertNoError(err, t, "setFunctionBreakpoint()")
|
||||||
stackBarrierGoids := []int{}
|
stackBarrierGoids := []int{}
|
||||||
for len(stackBarrierGoids) == 0 {
|
for len(stackBarrierGoids) == 0 {
|
||||||
assertNoError(p.Continue(), t, "Continue()")
|
err := p.Continue()
|
||||||
|
if _, exited := err.(ProcessExitedError); exited {
|
||||||
|
t.Logf("Could not run test")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
assertNoError(err, t, "Continue()")
|
||||||
gs, err := p.GoroutinesInfo()
|
gs, err := p.GoroutinesInfo()
|
||||||
assertNoError(err, t, "GoroutinesInfo()")
|
assertNoError(err, t, "GoroutinesInfo()")
|
||||||
for _, th := range p.threads {
|
for _, th := range p.threads {
|
||||||
|
Loading…
Reference in New Issue
Block a user