Skip to content

Conversation

@umanwizard
Copy link
Collaborator

@umanwizard umanwizard commented Dec 15, 2025

In Go, runtime.morestack is called by goroutines that have exhausted their stack space and need to create more. This can be a significant bottleneck in some programs. As can be seen from the above link, the function in question clears the frame pointer before calling into newstack, making it impossible for us to unwind further. Luckily, before doing so, it stashes the necessary registers on the current goroutine.

This PR introduces a new unwinding command specifically for unwinding past runtime.morestack. It uses the infrastructure already developed for Go Custom Labels to find the current goroutine, then grabs the appropriate values. Currently, this only works in Go 1.25 and does not work for kernel stacks; making it more general will be done in a later follow-up.

Copy link
Collaborator

@gnurizen gnurizen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, seems like the perfect candidate for a coredump unit test(s). It also seems like these changes will probably cause a fair bit of merge headache so once they are polished up we should look at upstreaming them.

@umanwizard umanwizard merged commit 5ff3b2b into main Dec 16, 2025
39 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants