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: programs sometimes stall at launch #37254

Closed
josharian opened this issue Feb 17, 2020 · 3 comments
Closed

runtime: programs sometimes stall at launch #37254

josharian opened this issue Feb 17, 2020 · 3 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@josharian
Copy link
Contributor

A weird thing has been happening to me recently, and I'm not sure how to debug it.

I'll run go install cmd/compile to install a modified compiler. (In this instance, the modifications were envvar-guarded logging, so it was not a broken compiler.)

Then I'll execute the compiler. To rule out any go tool problems or the like, I am running the compiler directly using an absolute path: /Users/josh/go/tip/pkg/tool/darwin_amd64/compile -S x.go. And the compiler hangs.

If I send a SIGQUIT, I don't get a backtrace:

$ /Users/josh/go/tip/pkg/tool/darwin_amd64/compile -S x.go
^\[1]    12198 quit       /Users/josh/go/tip/pkg/tool/darwin_amd64/compile -S x.go

It's as if the runtime stalled during launch.

Subsequent compiler runs usually work as normal.

I can't reproduce reliably, but it has happened enough that I think I'm probably not going crazy.

What should I do to debug next time this happens?

@ianlancetaylor
Copy link
Contributor

In a different terminal, run gdb on the executable, and attach to the stalled process. Do a backtrace to find out where it has stalled.

(Perhaps delve supports attaching to a process also, I don't know.)

@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 18, 2020
@toothrot toothrot added this to the Backlog milestone Feb 18, 2020
@josharian
Copy link
Contributor Author

This stopped happening after I filed the issue (of course). I will re-open, with gdb info, if it occurs again.

@gopherbot
Copy link

Change https://golang.org/cl/223240 mentions this issue: runtime: throttle signal senders when receivers aren't making progress

@golang golang locked and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants