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

Read errno before calling rb_io_path() #80

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Nov 26, 2024

Possible fix for recent crashes seen on CI.

 [BUG] rb_sys_fail_str(<STDIN>) - errno == 0

rb_io_path() calls rb_obj_dup(), which could call initialize_dup in Ruby and clobber errno before rb_sys_fail_str() gets to read errno. So save it out first.

(Using separate statements because order of evaluation in function call list is unspecified, and order is important here.)

Possible fix for recent crashes seen on CI.

     [BUG] rb_sys_fail_str(<STDIN>) - errno == 0

rb_io_path() calls rb_obj_dup(), which could call initialize_dup in Ruby
and clobber errno before rb_sys_fail_str() gets to read errno. So
save it out first.

(Using separate statements because order of evaluation in function call
list is unspecified, and order is important here.)
@XrXr XrXr requested review from hsbt and mame November 26, 2024 23:43
Copy link
Member

@mame mame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed!

@XrXr XrXr merged commit 0ba400b into ruby:master Nov 27, 2024
@XrXr XrXr deleted the errno-clobber branch December 2, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants