Age | Commit message (Collapse) | Author |
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4963
|
|
Previously, if an autoload failed (the file was loaded, but the
constant was not defined by the autoloaded file). Ruby will try
to autoload again if you delete the autoloaded file from
$LOADED_FEATURES. With this change, the autoload and the
constant itself are removed as soon as it fails.
To handle cases where multiple threads are autoloading, when
deleting an autoload, handle the case where another thread
already deleted it.
Fixes [Bug #15790]
Notes:
Merged: https://github.com/ruby/ruby/pull/4715
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
Also, check if a suffix is empty, to guarantee the assumption of
`onigenc_get_left_adjust_char_head` that `*s` is always accessible,
even in the case of `SHARABLE_MIDDLE_SUBSTRING`.
|
|
This commit dumps the outer variables table when dumping an iseq to
binary. This fixes a case where Ractors aren't able to tell what outer
variables belong to a lambda after the lambda is loaded via ISeq.load_from_binary
[Bug #18232] [ruby-core:105504]
Notes:
Merged: https://github.com/ruby/ruby/pull/4942
|
|
|
|
The test gets stuck on Solaris CI.
http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20211006T050007Z.fail.html.gz#test-all
```
[14558/21042] TestProcess#test_no_curdirtimeout: output interval exceeds 1800.0 seconds.
timeout: the process group 3857 is alive.
```
Related to ee89543e09a2d4e4c503267c248ba7bfffa668cb
|
|
Fixes [Feature #18148]
When set, all the loaded objects are returned as frozen.
If a proc is provided, it is called with the objects already frozen.
|
|
|
|
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:
Merged: https://github.com/ruby/ruby/pull/4935
|
|
Solaris CI still has a problem even with these commits, so it doesn't
appear to fix the issue. Reverting both 84e8e2a39bba874433b661bd378165bd03c9d6aa
and bfd2f159f0c60ef8ac5bce6042edd25a571769b7.
|
|
Remove temporary skip of test_no_curdir to see if this fixes the
problem.
Notes:
Merged: https://github.com/ruby/ruby/pull/4931
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4927
|
|
|
|
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.
It took me multiple attempts to get this working. My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES. Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.
This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.
When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt. I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.
Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.
To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.
Fixes [Bug #17885]
Notes:
Merged: https://github.com/ruby/ruby/pull/4887
|
|
In certain conditions, Regexp#match could return a MatchData with
missing captures. This seems to require at the least, multiple
threads calling a method that calls the same block/proc/lambda
which calls Regexp#match.
The race condition happens because the MatchData is passed from
indirectly via the backref, and other threads can modify the
backref.
Fix the issue by:
1. Not reusing the existing MatchData from the backref, and always
allocating a new MatchData.
2. Passing the MatchData directly to the caller using a VALUE*,
instead of indirectly through the backref.
It's likely that variants of this issue exist for other Regexp
methods. Anywhere that MatchData is passed implicitly through
the backref is probably vulnerable to this issue.
Fixes [Bug #17507]
Notes:
Merged: https://github.com/ruby/ruby/pull/4734
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4893
|
|
The feature names loaded from the default load paths should also
be in the file system encoding.
Notes:
Merged: https://github.com/ruby/ruby/pull/4915
|
|
Pass in ec to vm_opt_newarray_{max,min}. Avoids having to
call GET_EC inside the functions, for better performance.
While here, add a test for Array#min/max being redefined to
test_optimization.rb.
Fixes [Bug #18180]
Notes:
Merged: https://github.com/ruby/ruby/pull/4911
Merged-By: jeremyevans <code@jeremyevans.net>
|
|
For cyclic objects, it requires to keep a st_table of the partially
initialized objects.
Notes:
Merged-By: byroot <jean.boussier@gmail.com>
|
|
|
|
Make `Module#ancestors` not to include `BasicObject`.
Notes:
Merged: https://github.com/ruby/ruby/pull/4883
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4883
|
|
|
|
|
|
|
|
|
|
The module that is about to be included is considered initialized.
Notes:
Merged: https://github.com/ruby/ruby/pull/4868
|
|
Previously the test verified on MSWIN that huge values can not be stored in environment variables but that they can on others.
IMHO the intention of the test should not change between platforms.
Therefore this adjusts the test to have the same intention - that is to store a big value.
This also fixes compatibility with MINGW-UCRT, which previously failed with:
<Errno::EINVAL: Invalid argument - ruby_setenv(foo)>
test/ruby/test_env.rb:512:in `[]='
test/ruby/test_env.rb:512:in `block in test_huge_value'
Notes:
Merged: https://github.com/ruby/ruby/pull/4599
|
|
This reverts commit ddb85c5d2bdf75a83eb163856508691a7436b446.
This commit causes unexpected warnings in TestTranscode#test_loading_race
occasionally in CI.
|
|
This fixes issues with paths being loaded twice in certain cases
when symlinks are used.
It took me multiple attempts to get this working. My original
attempt tried to convert paths to realpaths before adding them
to $LOADED_FEATURES. Unfortunately, this doesn't work well
with the loaded feature index, which is based off load paths
and not realpaths. While I was able to get require working, I'm
fairly sure the loaded feature index was not being used as
expected, which would have significant performance implications.
Additionally, I was never able to get that approach working with
autoload when autoloading a non-realpath file. It also broke
some specs.
This takes a more conservative approach. Directly before loading the
file, if the file with the same realpath has been required, the
loading of the file is skipped. The realpaths are stored as
fstrings in a hidden hash.
When rebuilding the loaded feature index, the hash of realpaths
is also rebuilt. I'm guessing this makes rebuilding process
slower, but I don think that is a hot path. In general, modifying
loaded features is only done when reloading, and that tends to be
in non-production environments.
Change test_require_with_loaded_features_pop test to use 30 threads
and 300 iterations, instead of 4 threads and 1000 iterations.
I saw only sporadic failures with 4/1000, but consistent failures
30/300 threads. These failures were due to the fact that the
concurrent deletions from $LOADED_FEATURES in other threads can
result in rb_ary_entry returning nil when rebuilding the loaded
features index.
To avoid concurrency issues when rebuilding the loaded features
index, the building of the index itself is left alone, and
afterwards, a separate loop is done on a copy of the loaded feature
snapshot in order to rebuild the realpaths hash.
Fixes [Bug #17885]
Notes:
Merged: https://github.com/ruby/ruby/pull/4615
|
|
|
|
[Bug #18178]
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4858
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4858
|
|
|
|
The method to return the length of the matched substring
corresponding to the given argument.
Notes:
Merged: https://github.com/ruby/ruby/pull/4851
|
|
The method to return the single matched substring corresponding to
the given argument.
Notes:
Merged: https://github.com/ruby/ruby/pull/4851
|
|
If $LOADED_FEATURES is changed in the just required file, also the
index table needs to be updated before loaded_features_snapshot is
reset. If the snapshot is reset without updating the table, the
name of the added feature will not be found.
Notes:
Merged: https://github.com/ruby/ruby/pull/4849
|
|
|
|
Ref: https://bugs.ruby-lang.org/issues/18141
Notes:
Merged: https://github.com/ruby/ruby/pull/4797
|
|
Instead of looking for Object::ENV (which can be overwritten),
directly look for the envtbl variable. As that is static in hash.c,
and the lookup code is in process.c, add a couple non-static
functions that will return envtbl (or envtbl#to_hash).
Fixes [Bug #18164]
Notes:
Merged: https://github.com/ruby/ruby/pull/4834
|
|
|
|
Introduces specification tests for mixed values and value omissions for
Hashes and keyword arguments, such as `{ a:, b:, c: 3 }`.
Notes:
Merged: https://github.com/ruby/ruby/pull/4829
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4822
|
|
[Feature #14579]
|
|
The value of the dynamic key cannot be omitted for now.
|
|
`{x:, y:}` is a syntax sugar of `{x: x, y: y}`.
|