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

runtime: GOTRACEBACK=crash doesn't print user stack for threads on system stack (backport) #19637

Closed
aclements opened this issue Mar 21, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@aclements
Copy link
Member

commented Mar 21, 2017

@aclements aclements added this to the Go1.8.1 milestone Mar 21, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Apr 5, 2017

CL https://golang.org/cl/39600 mentions this issue.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Apr 5, 2017

Is this worthy of a backport? It doesn't appear to be a regression from Go 1.7? At least #19494 doesn't say so.

Ask @rsc if he's sitting there.

@aclements

This comment has been minimized.

Copy link
Member Author

commented Apr 5, 2017

It's not a regression, but it has interfered with debugging runtime issues in 1.8. The fix is trivial and obviously correct (though the test is mighty hairy).

@aclements

This comment has been minimized.

Copy link
Member Author

commented Apr 5, 2017

Cherry-picked to release.

@aclements aclements closed this Apr 5, 2017

gopherbot pushed a commit that referenced this issue Apr 5, 2017

[release-branch.go1.8] runtime: print user stack on other threads dur…
…ing GOTRACBEACK=crash

Currently, when printing tracebacks of other threads during
GOTRACEBACK=crash, if the thread is on the system stack we print only
the header for the user goroutine and fail to print its stack. This
happens because we passed the g0 to traceback instead of curg. The g0
never has anything set in its gobuf, so traceback doesn't print
anything.

Fix this by passing _g_.m.curg to traceback instead of the g0.

Fixes #19494.
Fixes #19637 (backport).

Change-Id: Idfabf94d6a725e9cdf94a3923dead6455ef3b217
Reviewed-on: https://go-review.googlesource.com/39600
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

@bradfitz bradfitz changed the title runtime: backport CL 38012 to 1.8.1 runtime: GOTRACEBACK=crash doesn't print user stack for threads on system stack (backport) Apr 7, 2017

@golang golang locked and limited conversation to collaborators Apr 7, 2018

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.