diff options
author | Jeremy Evans <[email protected]> | 2021-10-04 14:13:47 -0700 |
---|---|---|
committer | Jeremy Evans <[email protected]> | 2021-10-04 19:30:01 -0900 |
commit | ee89543e09a2d4e4c503267c248ba7bfffa668cb (patch) | |
tree | a5082f4273d64ae7f24210104b9eda0f17f1df5b /include/ruby/internal/encoding/string.h | |
parent | 16ce578da1aee4f4a365a4010dc904bc2f3c4ff9 (diff) |
Fix regression on Solaris after change to use realpath on loaded features
After the change to use realpath on loaded features, Solaris CI
started failing in test_no_curdir (which tests behavior for running
ruby without a working directory).
I was able to trace the problem to the following call chain:
rb_call_inits->Init_Thread->Init_thread_sync->rb_provide->
get_loaded_features_index->rb_check_realpath->rb_dir_getwd_ospath->
ruby_getcwd
This will throw an exception, but because Ruby hasn't been fully
initialized at the point the exception is thrown, it just exits
with a status of 1.
The bug here is that rb_check_realpath should not raise an
exception, it should return nil. This bug is hit on Solaris
because Solaris uses the realpath emulation instead of native
realpath, and the realpath emualation raised instead of
returning nil if the mode was RB_REALPATH_CHECK. Use rb_rescue
in the realpath emulation if the mode is RB_REALPATH_CHECK, and
swallow any exceptions raised and return nil.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4935
Diffstat (limited to 'include/ruby/internal/encoding/string.h')
0 files changed, 0 insertions, 0 deletions