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

C API execute blocks: non-Go code set up signal handler without SA_ONSTACK flag #1940

Closed
canepat opened this issue Mar 26, 2024 · 0 comments · Fixed by #1943
Closed

C API execute blocks: non-Go code set up signal handler without SA_ONSTACK flag #1940

canepat opened this issue Mar 26, 2024 · 0 comments · Fixed by #1943
Labels
bug Something isn't working

Comments

@canepat
Copy link
Member

canepat commented Mar 26, 2024

If you launch Silkworm C API block execution on Linux from Go code and then hit CTRL-C, you may sometimes encounter the following unhandled exception:

signal 2 received but handler not on signal stack
fatal error: non-Go code set up signal handler without SA_ONSTACK flag

This is because the Go runtime expects its signal handlers to be called on their dedicated signal stack, as stated in Go documentation:

If the non-Go code installs any signal handlers, it must use the SA_ONSTACK flag with sigaction. Failing to do so is likely to cause the program to crash if the signal is received. Go programs routinely run with a limited stack, and therefore set up an alternate signal stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant