Age | Commit message (Collapse) | Author |
|
87c546b5fa97e6e226cce4daf417617a1143f642,7a3322a0fd660d676f1918bd7c4a37676b44e1c2:
Avoid using inconsistent coding style
Other `_mjit_compile_*.erb` files don't use goto. These files'd better
be consistent for readability.
---
tool/ruby_vm/views/_mjit_compile_getinlinecache.erb | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
Fix broken JIT of getinlinecache
e7fc353f04 reverted vm_ic_hit_p's signature change made in 53babf35ef,
which broke JIT compilation of getinlinecache.
To make sure it doesn't happen again, I separated vm_inlined_ic_hit_p to
make the intention clear.
---
test/ruby/test_jit.rb | 12 +++++++++++
.../ruby_vm/views/_mjit_compile_getinlinecache.erb | 2 +-
vm_insnhelper.c | 25 ++++++++++++++--------
3 files changed, 29 insertions(+), 10 deletions(-)
|
|
4ae27d8075b2d138d13cb2b112f0ee50934b3017,2670509ebba5ba31a5bf34cf906943075446e005,8e2ac2140d1cd9c163c1556df58c020dc22ab269:
[ruby/net-ftp] Reduce resource cosumption of Net::FTP::TIME_PARSER
Reported by Alexandr Savca as a DoS vulnerability, but Net::FTP is a
client library and the impact of the issue is low, so I have decided
to fix it as a normal issue.
Based on patch by nobu.
https://github.com/ruby/net-ftp/commit/a93af636f8
---
lib/net/ftp.rb | 5 +++--
test/net/ftp/test_ftp.rb | 11 +++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
[ruby/net-ftp] Add test cases
https://github.com/ruby/net-ftp/commit/865232bb2a
---
test/net/ftp/test_ftp.rb | 6 ++++++
1 file changed, 6 insertions(+)
test/net/ftp/test_ftp.rb: reduce the size of a long response
"9" * 999999999 (about 1 GB) was too large for some CI servers.
This commit changes the size to 999999 (about 1 MB).
http://rubyci.s3.amazonaws.com/scw-9d6766/ruby-master/log/20210427T141707Z.fail.html.gz
http://rubyci.s3.amazonaws.com/raspbian10-aarch64/ruby-master/log/20210427T145408Z.fail.html.gz
---
test/net/ftp/test_ftp.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
611e711085c7e3984555a79626d025c8b876eced,a9c5c2d614f30a616970245fef3e7ffc151e2ecf: [Backport #17527]
Test incorrect behaviour of `rb_io_wait_readable/writable`.
---
test/fiber/test_io.rb | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
Check errno before invoking scheduler in
`rb_io_wait_readable/writable`.
See <https://bugs.ruby-lang.org/issues/17527> for more details.
---
io.c | 66 +++++++++++++++++++++++++++++++++++-------------------------------
1 file changed, 35 insertions(+), 31 deletions(-)
|
|
|
|
4250d7c910fd67c0da07c6213901009330e3cd51,83f96642d2d74569cc38319d02d5922fac8f66b8,447feb0aa08e20cc5eeb8b3a6f881de261a2c9a2,1d80d703141f01383604022f9e8e53e10865197c,e271a3d4afc47e812b50fc9c50f6bf34d2d723a6,366e88e508de7c59d69906ad948cccd7979e932b,d825e34962540d345eb3c5a70eb264b415e915a5,4250d7c910fd67c0da07c6213901009330e3cd51,f9e43782995b1f77e7b10c79941bbbda15620e2a: [Backport #17723]
autogen.sh: Added
Currently it just runs "autoreconf --install"
---
aclocal.m4 | 4 ++--
autogen.sh | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
create mode 100755 autogen.sh
autogen.sh: Allow AUTORECONF envvar to specify the autoreconf
executable
---
autogen.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Improved autogen.sh
* update in the source directory
* make symbolic links instead of copies
* forward the arguments to autoreconf as-is
---
autogen.sh | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
autogen.sh: Make it work with sh (not bash)
---
autogen.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[DOC] Update README files to use autoreconf [ci skip]
---
README.ja.md | 3 +--
README.md | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
[DOC] Update README [ci skip]
* Use `autogen.sh`.
* The subversion repository is only for old versions, and
secondary now.
* Moved long links to footnotes.
---
README.ja.md | 22 +++++++++-------------
README.md | 11 +++++++----
2 files changed, 16 insertions(+), 17 deletions(-)
Use autogen.sh
---
.github/workflows/baseruby.yml | 2 +-
.github/workflows/check_dependencies.yml | 2 +-
.github/workflows/compilers.yml | 2 +-
.github/workflows/macos.yml | 2 +-
.github/workflows/mjit.yml | 2 +-
.github/workflows/ubuntu.yml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
autogen.sh: Added
Currently it just runs "autoreconf --install"
---
aclocal.m4 | 4 ++--
autogen.sh | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
create mode 100755 autogen.sh
get rid of aclocal (#4280)
---
aclocal.m4 | 47 -----------------------------------------------
configure.ac | 35 ++++++++++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 48 deletions(-)
|
|
spec/ruby/core/hash/transform_keys_spec.rb: Fix the failure of
ruby_3_0
https://github.com/ruby/spec/pull/833
https://github.com/ruby/spec/commit/8290e5ad8952b14ee9a5069651d9864c66681112
---
spec/ruby/core/hash/transform_keys_spec.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
Update for autoconf 2.70
---
configure.ac | 232 +++++++++++++++++------------------
tool/m4/ruby_check_builtin_setjmp.m4 | 8 +-
tool/m4/ruby_check_printf_prefix.m4 | 9 +-
tool/m4/ruby_check_setjmp.m4 | 6 +-
tool/m4/ruby_check_sysconf.m4 | 6 +-
tool/m4/ruby_cppoutfile.m4 | 4 +-
tool/m4/ruby_decl_attribute.m4 | 4 +-
tool/m4/ruby_dtrace_available.m4 | 2 +-
tool/m4/ruby_dtrace_postprocess.m4 | 2 +-
tool/m4/ruby_mingw32.m4 | 4 +-
tool/m4/ruby_stack_grow_direction.m4 | 4 +-
tool/m4/ruby_try_cflags.m4 | 2 +-
tool/m4/ruby_try_cxxflags.m4 | 2 +-
tool/m4/ruby_try_ldflags.m4 | 2 +-
14 files changed, 143 insertions(+), 144 deletions(-)
Revert AC_PROG_CC_C99 for -std=gnu99 option to gcc 4.8
---
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
Removed unused AC_CHECKING
---
configure.ac | 7 -------
1 file changed, 7 deletions(-)
|
|
31e0382723bfb35cffe3ca485dd0577668cafa07,5e5fb72f99701dc27c66ab148471893f14e6d6f0,fb6ebe55d91187d9635e0183d47dbf38e95b1141,522d4cd32f7727886f4fcbc28ed29c08d361ee20: [Backport #17735]
Keep non evaluated keys in `Hash#transform_keys!` [Bug #17735]
---
hash.c | 6 +++++-
spec/ruby/core/hash/transform_keys_spec.rb | 12 +++++++++++-
test/ruby/test_hash.rb | 8 ++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
Clear an intermediate hash [Bug #17735]
---
hash.c | 1 +
1 file changed, 1 insertion(+)
Hide an intermediate array
---
hash.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Force recycle intermediate collection in Hash#transform_keys! [Bug
#17735]
* Force recycle intermediate hash
* Force recycle intermediate array too
https://github.com/ruby/ruby/pull/4329#issuecomment-808840718
---
hash.c | 2 ++
1 file changed, 2 insertions(+)
|
|
test/drb/test_drb.rb: Specify the host of DRbServer
to try fixing the following error.
http://rubyci.s3.amazonaws.com/opensuseleap/ruby-master/log/20210407T063004Z.log.html.gz
```
[ 605/21105] DRbTests::TestDRbSSLAry#test_06_next/home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/drb.rb:1138:in `method_missing': undefined method `regist' for [1, 2, "III", 4, "five", 6]:Array (NoMethodError)
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:21:in `block in initialize'
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `synchronize'
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/.ext/common/monitor.rb:202:in `mon_synchronize'
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/lib/drb/extserv.rb:20:in `initialize'
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `new'
from /home/chkbuild/chkbuild/tmp/build/20210407T063004Z/ruby/test/drb/ut_array_drbssl.rb:35:in `<main>'
= 100.05 s
```
Here is my analysis:
The test of drb used both `druby://:0` and `druby://localhost:0` for
DRbServer. However, the former listens on IPv4, and the latter does on
IPv6, depending on environments. The port 0 is automatically assigned,
but sometimes the same port is used to both because they are different
protocols (IPv4 and IPv6). In this case, their URIs are resolved to the
completely same one (`druby://localhost:port`), which confuses the
method `DRb.here?` which determines the DRbObject is remote or local.
This changeset uses `druby://localhost:0` consistently.
---
test/drb/test_drb.rb | 4 ++--
test/drb/test_drbssl.rb | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
|
|
https://github.com/ruby/tmpdir/commit/c79bc7adf6
|
|
|
|
|
|
|
|
Remove other than alphanumeric and some punctuations considered
filesystem-safe, instead of removing some unsafe chars only.
https://hackerone.com/reports/1131465
|
|
|
|
* [ruby/irb] Update help message for next context-mode of 4
While here, fixing tab/space issues in help message, and sync
rdoc for IRB class to match the help message.
https://github.com/ruby/irb/commit/ef8e3901cc
* [ruby/irb] Do not continue line if last expression is an endless range
Fixes [Bug #14824]
https://github.com/ruby/irb/commit/63414f8465
* [ruby/irb] Add a test for not continuing when endless range at eol
https://github.com/ruby/irb/commit/1020ac9c65
* [ruby/irb] Make save-history extension safe for concurrent use
This makes the save-history extension check for modifications to
the history file before saving it. If the history file was modified
after the history was loaded and before it was saved, append only
the new history lines to the history file.
This can result in more lines in the history file than SAVE_HISTORY
allows. However, that will be fixed the next time irb is run and
the history is saved.
Fixes [Bug #13654]
https://github.com/ruby/irb/commit/041ef53845
* Fix errors when XDG_CONFIG_HOME points to non-writable directory
`$HOME/.config` is not writable on CI
because I think tests should not corrupt user's data.
And GitHub Actions CI sets `XDG_CONFIG_HOME`
since `Version: 20210309.1`.
https://github.com/ruby/actions/runs/2130811016?check_suite_focus=true#step:16:301
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
* Try to fix errors in TestIRB::TestHistory too
https://github.com/ruby/actions/runs/2137935523?check_suite_focus=true#step:9:562
```
1) Error:
TestIRB::TestHistory#test_history_concurrent_use:
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `mkdir'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:253:in `fu_mkdir'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:231:in `block (2 levels) in mkdir_p'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `reverse_each'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:229:in `block in mkdir_p'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `each'
/home/runner/work/actions/actions/ruby/lib/fileutils.rb:211:in `mkdir_p'
/home/runner/work/actions/actions/ruby/lib/irb/init.rb:355:in `rc_file_generators'
/home/runner/work/actions/actions/ruby/lib/irb/init.rb:330:in `rc_file'
/home/runner/work/actions/actions/ruby/test/irb/test_history.rb:170:in `block in assert_history'
/home/runner/work/actions/actions/ruby/lib/tmpdir.rb:96:in `mktmpdir'
/home/runner/work/actions/actions/ruby/test/irb/test_history.rb:168:in `assert_history'
/home/runner/work/actions/actions/ruby/test/irb/test_history.rb:133:in `test_history_concurrent_use'
```
* [ruby/irb] Define "measure" command without forced override
https://github.com/ruby/irb/commit/9587ba13b5
* [ruby/irb] Add all lib files automatically
https://github.com/ruby/irb/commit/ecc82336b7
* [ruby/irb] Don't call Ruby 2.4+'s String#pretty_print
https://github.com/ruby/irb/commit/89bcf107be
* [ruby/irb] Implement ls command
https://github.com/ruby/irb/commit/19b6c20604
* [ruby/irb] Add whereami command
https://github.com/ruby/irb/commit/bc822e4aac
* [ruby/irb] Fix column overflow on ls output
https://github.com/ruby/irb/commit/6115754623
* [ruby/irb] Fix step's argument
cols.size was calling Integer#size, which returns 8.
Fixing a bug of https://github.com/ruby/irb/pull/209
https://github.com/ruby/irb/commit/c93ae4be71
* [ruby/irb] Deal with different screen sizes
e.g. http://rubyci.s3.amazonaws.com/centos8/ruby-master/log/20210321T063003Z.fail.html.gz
https://github.com/ruby/irb/commit/ddb3472ba2
* [ruby/irb] Have some right padding
instead of filling out an entire line
https://github.com/ruby/irb/commit/6ac8f45f5f
* Suppress verbose messages
Get rid of warnings in the parallel test.
```
unknown command: "Switch to inspect mode."
```
* [ruby/irb] Change ripper_lex_without_warning to a class method
https://github.com/ruby/irb/commit/d9f8abc17e
* [ruby/irb] Complete require and require_relative
https://github.com/ruby/irb/commit/1c61178b4c
* [ruby/reline] Add Reline.ungetc to control buffer
https://github.com/ruby/reline/commit/43ac03c624
* [ruby/reline] Reline.delete_text removes the current line in multiline
https://github.com/ruby/reline/commit/da90c094a1
* [ruby/reline] Support preposing and postposing for Reline.completion_proc
https://github.com/ruby/reline/commit/1f469de90c
* [ruby/reline] Suppress crashing when completer_{quote,word_break}_characters is empty
https://github.com/ruby/reline/commit/c6f1164942
* [ruby/irb] fix completion test when out-of-place build
* [ruby/irb] Cache completion files to require
https://github.com/ruby/irb/commit/612ebcb311
* [ruby/irb] Always add input method when calling Irb.new in tests
When passes input method as nil to Context.new through Irb.new,
ReidlineInputMethod.new is executed and the global internal state of Reline is
rewritten, therefore other tests are failed in the Ruby repository. This
commit changes to use TestInputMethod.
https://github.com/ruby/irb/commit/010dce9210
* [ruby/irb] Prevent the completion from crashing if rdoc is missing
There are cases where ruby is installed without rdoc and e.g.
lib/irb/cmd/help.rb also handles the LoadError
Here is how to replicate the issue:
```
$ docker run -it alpine:3.13.3 sh
/ # apk add ruby ruby-irb ruby-io-console
/ # irb
irb(main):001:0> Class[TAB][TAB]
```
And you end up with something like:
```
irb(main):001:0> ClassTraceback (most recent call last):
34: from /usr/bin/irb:23:in `<main>'
33: from /usr/bin/irb:23:in `load'
32: from /usr/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
31: from /usr/lib/ruby/2.7.0/irb.rb:400:in `start'
30: from /usr/lib/ruby/2.7.0/irb.rb:471:in `run'
29: from /usr/lib/ruby/2.7.0/irb.rb:471:in `catch'
28: from /usr/lib/ruby/2.7.0/irb.rb:472:in `block in run'
27: from /usr/lib/ruby/2.7.0/irb.rb:537:in `eval_input'
26: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:150:in `each_top_level_statement'
25: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:150:in `catch'
24: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:151:in `block in each_top_level_statement'
23: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:151:in `loop'
22: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:154:in `block (2 levels) in each_top_level_statement'
21: from /usr/lib/ruby/2.7.0/irb/ruby-lex.rb:182:in `lex'
20: from /usr/lib/ruby/2.7.0/irb.rb:518:in `block in eval_input'
19: from /usr/lib/ruby/2.7.0/irb.rb:704:in `signal_status'
18: from /usr/lib/ruby/2.7.0/irb.rb:519:in `block (2 levels) in eval_input'
17: from /usr/lib/ruby/2.7.0/irb/input-method.rb:294:in `gets'
16: from /usr/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
15: from /usr/lib/ruby/2.7.0/forwardable.rb:235:in `readmultiline'
14: from /usr/lib/ruby/2.7.0/reline.rb:175:in `readmultiline'
13: from /usr/lib/ruby/2.7.0/reline.rb:238:in `inner_readline'
12: from /usr/lib/ruby/2.7.0/reline.rb:238:in `loop'
11: from /usr/lib/ruby/2.7.0/reline.rb:239:in `block in inner_readline'
10: from /usr/lib/ruby/2.7.0/reline.rb:270:in `read_io'
9: from /usr/lib/ruby/2.7.0/reline.rb:270:in `loop'
8: from /usr/lib/ruby/2.7.0/reline.rb:311:in `block in read_io'
7: from /usr/lib/ruby/2.7.0/reline.rb:240:in `block (2 levels) in inner_readline'
6: from /usr/lib/ruby/2.7.0/reline.rb:240:in `each'
5: from /usr/lib/ruby/2.7.0/reline.rb:241:in `block (3 levels) in inner_readline'
4: from /usr/lib/ruby/2.7.0/reline/line_editor.rb:820:in `input_key'
3: from /usr/lib/ruby/2.7.0/reline/line_editor.rb:608:in `complete'
2: from /usr/lib/ruby/2.7.0/irb/completion.rb:269:in `block in <module:InputCompletor>'
1: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- rdoc (LoadError)
```
https://github.com/ruby/irb/commit/a2d299c2ac
* [ruby/irb] Suppress verbose messages in the parallel test
`:VERBOSE` flag needs to be set prior to `IRB::Irb.new`.
https://github.com/ruby/irb/commit/78604682d9
* [ruby/irb] SIGINT should raise Interrupt after IRB session
https://github.com/ruby/irb/commit/5832cfe75b
* [ruby/irb] Colorize `__END__` as keyword
https://github.com/ruby/irb/commit/9b84018311
* [ruby/irb] Add show_source command
https://github.com/ruby/irb/commit/108cb04352
* [ruby/reline] Reset @rest_height when clear screen
https://github.com/ruby/reline/commit/3a7019b0d5
* [ruby/irb] process multi-line pastes as a single entity
this allows pasting leading-dot chained methods correctly:
```ruby
class A
def a; self; end
def b; true; end
end
a = A.new
a
.a
.b
```
will properly return `true` instead of erroring on the `.a` line:
```
irb(main):001:1* class A
irb(main):002:1* def a; self; end
irb(main):003:0> end
irb(main):004:0*
irb(main):005:0> a = A.new
irb(main):006:0*
irb(main):007:0> a
irb(main):008:0> .a
irb(main):009:0> .a
=> #<A:0x00007f984211fbe8>
```
https://github.com/ruby/irb/commit/45aeb52575
* [ruby/irb] Add yamatanooroti test example
https://github.com/ruby/irb/commit/279155fcee
* [ruby/irb] Add test for multiline paste
https://github.com/ruby/irb/commit/e93c9cb54d
* [ruby/irb] Evaluate each toplevel statement
https://github.com/ruby/irb/commit/bc1b1d8bc3
* [ruby/irb] Version 1.3.5
https://github.com/ruby/irb/commit/22e2ddf715
* [ruby/reline] Version 0.2.5
https://github.com/ruby/reline/commit/22ce5651e5
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Aleksandar Ivanov <aivanov92@gmail.com>
Co-authored-by: Koichi Sasada <ko1@atdot.net>
Co-authored-by: Cody Cutrer <cody@instructure.com>
|
|
Fix segmentation fault when `Module#name` returns non string value
[Bug #17754]
* Add test for NoMethodError#to_s does not segfault
* Ensure no segfault even if Module#name is overridden
---
error.c | 4 +++-
test/ruby/test_nomethod_error.rb | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
|
|
Ensure that caller respects the start argument
Previously, if there were ignored frames (iseq without pc), we could
go beyond the requested start frame. This has two changes:
1) Ensure that we don't look beyond the start frame by using
last_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(last_cfp) until the
desired start frame is reached.
2) To fix the failures caused by change 1), which occur when a
limited number of frames is requested, scan the VM stack before
allocating backtrace frames, looking for ignored frames. This
is complicated if there are ignored frames before and after
the start, in which case we need to scan until the start frame,
and then scan backwards, decrementing the start value until we
get to the point where start will result in the number of
requested frames.
This fixes a Rails test failure. Jean Boussier was able to
to produce a failing test case outside of Rails.
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
---
test/ruby/test_backtrace.rb | 16 ++++++++++++++
vm_backtrace.c | 52 +++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 66 insertions(+), 2 deletions(-)
|
|
rb_enc_interned_str: handle autoloaded encodings
If called with an autoloaded encoding that was not yet
initialized, `rb_enc_interned_str` would crash with
a NULL pointer exception.
See: https://github.com/ruby/ruby/pull/4119#issuecomment-800189841
---
encoding.c | 28 ++++++++++++----------------
ext/-test-/string/depend | 3 +++
ext/-test-/string/fstring.c | 15 +++++++++++++++
internal/encoding.h | 3 +++
string.c | 4 ++++
test/-ext-/string/test_fstring.rb | 16 ++++++++++++++++
6 files changed, 53 insertions(+), 16 deletions(-)
|
|
Fix Enumerable#inject with high negative fixnums [Bug #17731]
---
enum.c | 2 +-
test/ruby/test_enum.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
Fix infinite loop at illegal sequence [Bug #17729]
As mblen returns -1 on failure, skip the first byte and try the
succeeding bytes in that case.
Close https://github.com/ruby/ruby/pull/4281
---
eval_intern.h | 11 ++++++++++-
test/ruby/test_rubyoptions.rb | 5 +++++
2 files changed, 15 insertions(+), 1 deletion(-)
|
|
Skip refined method when exporting methods with changed visibility
Previously, attempting to change the visibility of a method in a
singleton class for a class/module that is prepended to and refined
would raise a NoMethodError.
Fixes [Bug #17519]
---
test/ruby/test_module.rb | 23 +++++++++++++++++++++++
vm_method.c | 14 +++++++++++---
2 files changed, 34 insertions(+), 3 deletions(-)
|
|
|
|
|
|
2a6bfd22468343003463e0cbf91953a01b0dbba5,3ac28de5414c81a0da8c8ec969ea74db5a0f1b0f: [Backport #17645]
Properly convert time_t [Bug #17645]
---
thread_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Explicitly cast __s64 to time_t [Bug #17645]
A workaround of shorten-64-to-32 error where 32-bit linux.
---
file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
[ruby/io-wait] Declare as Ractor-safe
Fixes https://bugs.ruby-lang.org/issues/17659
https://github.com/ruby/io-wait/commit/ba338b4764
---
ext/io/wait/wait.c | 4 ++++
test/io/wait/test_ractor.rb | 22 ++++++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 test/io/wait/test_ractor.rb
|
|
* [ruby/io-console] [DOC] Note that IO#getpass returns a chomped string
IO#getpass uses String#chomp! on the read input line.
https://github.com/ruby/io-console/commit/1e98c93bc8
* [ruby/io-console] Ignore chomp! result and return the modified string
https://github.com/ruby/io-console/commit/09e5ccc729
* [ruby/io-console] Pre-define chomp! ID
https://github.com/ruby/io-console/commit/028e1c9497
* [ruby/io-console] Shrink struct query_args
https://github.com/ruby/io-console/commit/720be0a3e5
* [ruby/io-console] bump up to 0.5.7
https://github.com/ruby/io-console/commit/f55d7ebff6
Co-authored-by: Marcus Stollsteimer <sto.mar@web.de>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
Make Ractor stdio belonging to the Ractor [Bug #17672]
Defer making ractor stdio until ractor started.
Before ractor started, created objects belong to the caller ractor
instead of the created ractor.
---
bootstraptest/test_ractor.rb | 12 ++++++++++++
ractor.c | 9 ---------
thread.c | 9 +++++++++
3 files changed, 21 insertions(+), 9 deletions(-)
|
|
63abb5c227e5c20d18d0debf699251da93ca64b5,34d02631e71209b12abb69d0114601027e485bc9,2adbf01ae14c0a4cf190b7c969b91726966a0e0f,3acc81d9e41b18380b9e0168fe2b5e5e0c727256: [Backport #17612]
dtoa.c: make compilable independently
Except for `-Dxmalloc=malloc -Dxfree=free`.
---
missing/dtoa.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
dtoa.c: constified
clang seems to locate never modified local data in the const
segment implicitly.
---
missing/dtoa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
dtoa.c: make thread-safe by using atomic CAS
---
common.mk | 2 ++
missing/dtoa.c | 75 ++++++++++++++++++++++++++++++++++++++++++----------------
util.c | 1 +
3 files changed, 57 insertions(+), 21 deletions(-)
Fixed race in dtoa [Bug #17612]
Fixed the race condition when replacing `freelist` entry with its
chained next element. At acquiring an entry, hold the entry once
with the special value, then release by replacing it with the next
element again after acquired. If another thread is holding the
same entry at that time, spinning until the entry gets released.
Co-Authored-By: Koichi Sasada <ko1@atdot.net>
---
bootstraptest/test_ractor.rb | 11 +++++++++++
missing/dtoa.c | 13 ++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
|
|
|
|
Ractor.allocate should not be allowed
Ractor.allocate and Ractor#dup should not be allowed like Thread.
[Bug #17642]
---
bootstraptest/test_ractor.rb | 18 ++++++++++++++++++
ractor.c | 2 ++
2 files changed, 20 insertions(+)
|
|
if cc is invalidated, cc should be released from iseq.
|
|
sync check_rvalue_consistency_force()
check_rvalue_consistency_force() uses is_pointer_to_heap() and
it should be synchronized with other ractors.
[Bug #17636]
---
gc.c | 149 ++++++++++++++++++++++++++++++++++---------------------------------
1 file changed, 76 insertions(+), 73 deletions(-)
|
|
abdc634f64a440afcdc7f23c9757d27aab4db8a9,083c5f08ec4e95c9b75810d46f933928327a5ab3,1ecda213668644d656eb0d60654737482447dd92,813fe4c256f89babebb8ab53821ae5eb6bb138c6: [Backport #17497]
remove unused decl
---
internal/vm.h | 6 ------
vm_args.c | 2 --
2 files changed, 8 deletions(-)
Check stack overflow in recursive glob_helper [Bug #17162]
---
dir.c | 2 ++
internal/vm.h | 1 +
vm_eval.c | 10 ++++++++++
3 files changed, 13 insertions(+)
global call-cache cache table for rb_funcall*
rb_funcall* (rb_funcall(), rb_funcallv(), ...) functions invokes
Ruby's method with given receiver. Ruby 2.7 introduced inline method
cache with static memory area. However, Ruby 3.0 reimplemented the
method cache data structures and the inline cache was removed.
Without inline cache, rb_funcall* searched methods everytime.
Most of cases per-Class Method Cache (pCMC) will be helped but
pCMC requires VM-wide locking and it hurts performance on
multi-Ractor execution, especially all Ractors calls methods
with rb_funcall*.
This patch introduced Global Call-Cache Cache Table (gccct) for
rb_funcall*. Call-Cache was introduced from Ruby 3.0 to manage
method cache entry atomically and gccct enables method-caching
without VM-wide locking. This table solves the performance issue
on multi-ractor execution.
[Bug #17497]
Ruby-level method invocation does not use gccct because it has
inline-method-cache and the table size is limited. Basically
rb_funcall* is not used frequently, so 1023 entries can be enough.
We will revisit the table size if it is not enough.
---
debug_counter.h | 3 +
vm.c | 12 +++
vm_callinfo.h | 12 ---
vm_core.h | 5 +
vm_eval.c | 288 ++++++++++++++++++++++++++++++++++++++++++--------------
vm_insnhelper.c | 11 ++-
vm_method.c | 14 ++-
7 files changed, 255 insertions(+), 90 deletions(-)
opt_equality_by_mid for rb_equal_opt
This patch improves the performance of sequential and parallel
execution of rb_equal() (and rb_eql()).
[Bug #17497]
rb_equal_opt (and rb_eql_opt) does not have own cd and it waste
a time to initialize cd. This patch introduces opt_equality_by_mid()
to check equality without cd.
Furthermore, current master uses "static" cd on rb_equal_opt
(and rb_eql_opt) and it hurts CPU caches on multi-thread execution.
Now they are gone so there are no bottleneck on parallel execution.
---
vm_insnhelper.c | 99 ++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 63 insertions(+), 36 deletions(-)
|
|
Destroy VM-wise locks before freeing [Bug #15852]
---
thread.c | 7 -------
vm.c | 2 ++
2 files changed, 2 insertions(+), 7 deletions(-)
|
|
|
|
This test was triggering require of `rubygems/core_ext/tcpsocket_init`
which overrides TCPSocket.initialize globally. Requires don't get
reset between test runs and it was making other test unreliable.
Fixes timeout of test on ruby master
https://github.com/rubygems/rubygems/commit/fdfe5c9691
|
|
|
|
|
|
|
|
|
|
|
|
0d89aedb734372bc35d8a569a992d13e86e7923e,a6f5f3cccda381ae332aaa6467f2644611371fb5,97cf290063ab940d08819cd96cbcca0ef6d50e4c: [Backport #17338]
Assign TAG_NONE to ruby_tag_type instead of 0
---
eval.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Also `eclass` loop can raise in `rb_obj_is_kind_of`
---
eval.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Copy va_list of exception classes
The list is reused when an exception raised again after retrying
in the rescue procedure.
---
eval.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
969b824a0c7605e0e570631d967ad0de0c37d0bf,100e464bee46ae71ef048ed85a9bdd012935a3f7: [Backport #17599]
sync GC rest if needed
marking requires a barrier (stop all Ractors) and gc_enter() does it.
However, it doesn't check rest event which can start marking.
[Bug #17599]
---
gc.c | 3 +++
1 file changed, 3 insertions(+)
clear RVALUE on NEWOBJ event.
NEWOBJ event is called without clearing RVALUE values (v1, v2, v3).
This patch clear them before NEWOBJ tracepoint internal hook.
[Bug #17599]
---
gc.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
|
|
Fix backtrace to not skip frames with iseq without pc
Previously, frames with iseq but no pc were skipped (even before
the refactoring in 3b24b7914c16930bfadc89d6aff6326a51c54295).
Because the entire backtrace was procesed before the refactoring,
this was handled by using later frames instead. However, after
the refactoring, we need to handle those frames or they get
lost.
Keep two iteration counters when iterating, one for the desired
backtrace size (so we generate the desired number of frames), and
one for the actual backtrace size (so we don't process off the end
of the stack). When skipping over an iseq frame with no pc,
decrement the counter for the desired backtrace, so it will
continue to process the expected number of backtrace frames.
Fixes [Bug #17581]
---
test/ruby/test_backtrace.rb | 12 ++++++++++++
vm_backtrace.c | 16 +++++++++-------
2 files changed, 21 insertions(+), 7 deletions(-)
|