Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
runtime: "fatal: morestack on g0" and blocking forever when go export functions is called in any signal handlers registered by the non-Go code #35814
What version of Go are you using (
I'm sorry, this will never work. A signal handler can only call async-signal-safe functions. Go code will never be async-signal-safe. That would be nearly impossible to implement, and it is not a goal.
I recommend that you open a pipe, read from the pipe on the Go side, and in the signal handler write a byte to the pipe. The write call is async-signal-safe.