You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Using goleak with trace flag in earlier versions of go (go1.13.10) is working fine due to fixed issue #39.
But in recent version of go (go1.17.1) testing simple programs with trace flag is failing again. I think the stack trace has now hidden the call to runtime.goparkunlock
make test:
[Goroutine 18 in state trace reader (blocked), with runtime.ReadTrace on top of the stack:
goroutine 18 [trace reader (blocked)]:
runtime.ReadTrace()
/usr/local/go/src/runtime/trace.go:412 +0xd2
runtime/trace.Start.func1()
/usr/local/go/src/runtime/trace/trace.go:129 +0x47
created by runtime/trace.Start
/usr/local/go/src/runtime/trace/trace.go:127 +0xf4
This fixes#66 .
On newer Go versions (1.16 onwards), the top of trace stacks is no longer runtime.goparkunlock. We had a logic that relied on this being the case, which made the tests to fail with -trace flag for newer Go versions. However, to maintain backwards compatibility, we shouldn't just remove this check.
This separates out the isTraceStack into a separate file that gets conditionally compiled on different Go versions (tracestack_old.go for Go 1.15 and before and tracestack_new.go for Go 1.16 and newer) to address this issue.
Internal Ref: GO-887.
Problem:
Using goleak with trace flag in earlier versions of go (go1.13.10) is working fine due to fixed issue #39.
But in recent version of go (go1.17.1) testing simple programs with
trace flag
is failing again. I think the stack trace has now hidden the call toruntime.goparkunlock
Possible Solution:
Removing this piece of code:
goleak/options.go
Lines 159 to 161 in 1e9de54
The text was updated successfully, but these errors were encountered: