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

Use the rb_sys_fail_str macro in signal.c #7812

Merged
merged 1 commit into from
May 15, 2023
Merged

Use the rb_sys_fail_str macro in signal.c #7812

merged 1 commit into from
May 15, 2023

Conversation

wks
Copy link
Contributor

@wks wks commented May 15, 2023

Let signal.c include "internal/error.h" explicitly to ensure that the identifier rb_sys_fail_str in signal.c refers to the macro defined in "internal/error.h" instead of the actual function.

That macro reads errno before evaluating its argument. Without this change, the rb_signo2signm(sig) expression in the trap function in signal.c will overwrite the errno before the actual rb_sys_fail_str function reads the errno.

Fixes: https://bugs.ruby-lang.org/issues/19635

Let signal.c include "internal/error.h" explicitly to ensure that the
identifier rb_sys_fail_str in signal.c refers to the macro defined in
"internal/error.h" instead of the actual function.

That macro reads errno before evaluating its argument.  Without this
change, the rb_signo2signm(sig) expression in the "trap" function in
signal.c will overwrite the errno before the actual rb_sys_fail_str
function reads the errno.
@nobu nobu merged commit c7067ed into ruby:master May 15, 2023
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants