提交 b9bdf597 编写于 作者: A Alessandro Arzilli 提交者: Derek Parker

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.
上级 dd3cc63d
......@@ -2436,13 +2436,27 @@ func TestStacktraceWithBarriers(t *testing.T) {
// stack frame with the address of runtime.stackBarrier.
// The original return address is saved into the stkbar slice inside the G
// 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) {
// 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")
assertNoError(err, t, "setFunctionBreakpoint()")
stackBarrierGoids := []int{}
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()
assertNoError(err, t, "GoroutinesInfo()")
for _, th := range p.threads {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册