Repository navigation
fix(runtime): print errno on sigaltstack errors - #14928
Open
dijkstracula wants to merge 2 commits into
Open
dijkstracula wants to merge 2 commits into
dijkstracula wants to merge 2 commits into
Conversation
dijkstracula
force-pushed
the
signal_stack_errno
branch
from
July 12, 2026 20:41
7219119 to
86122eb
Compare
miodvallat
reviewed
Jul 14, 2026
miodvallat
left a comment
There was a problem hiding this comment.
Wouldn't it better to use caml_strerror instead of strerror in this PR?
Contributor
Author
|
Fair point @miodvallat . Change made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear OCaml maintainers,
Internally at Semgrep, we've been trying to diagnose some failures that stem from not being able to correctly set up the signal stack. Currently,
caml_init_signalsonly printsFailed to allocate signal stack for domain 0(that is, we drop the errno, so we're not exactly sure what's going wrong). This patch simply turns the errno into a printable string viastrerror(3)and adds that to the output. Similarly,caml_free_signal_stackdid sort of the right thing in that it prints out the errno number but not the string form; this patch passes that usage throughstrerroras well.Since this error only happens very occasionally, I've not been able to directly test this patch beyond "force a failure and set errno" one-off test, but we are also pulling this into our fork for internal use, too.
Thanks, and to the Europeans, hope you are staying cool,
Nathan