Age | Commit message (Collapse) | Author |
|
Revert "Force recycle intermediate collection in Hash#transform_keys!
[Bug #17735]"
This reverts commit 522d4cd32f7727886f4fcbc28ed29c08d361ee20.
---
hash.c | 1 -
1 file changed, 1 deletion(-)
|
|
Preserve the encoding of the argument in IndexError [Bug #18160]
---
re.c | 20 ++++++++++----------
test/ruby/test_regexp.rb | 7 ++++++-
2 files changed, 16 insertions(+), 11 deletions(-)
|
|
[ruby/strscan] Fix segmentation fault of `StringScanner#charpos` when
`String#byteslice` returns non string value [Bug #17756] (#20)
https://github.com/ruby/strscan/commit/92961cde2b
---
ext/strscan/strscan.c | 5 +----
test/strscan/test_stringscanner.rb | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 4 deletions(-)
|
|
Check if closed after each yield [Bug #17661]
---
io.c | 4 +++-
test/ruby/test_io.rb | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 1 deletion(-)
|
|
[Bug #18154] Fix memory leak in String#initialize
String#initialize can leak memory when called on a string that is marked
with STR_NOFREE because it does not unset the STR_NOFREE flag.
---
string.c | 2 +-
test/ruby/test_string.rb | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
|
|
Use free instead of xfree to free altstack
The altstack memory of a thread may be free'ed even after the VM is
destructed. After that, GC is no longer available, so calling xfree
may lead to a segfault.
This changeset uses the bare free function to free the altstack memory
instead of xfree. [Bug #18126]
---
signal.c | 5 ++++-
vm_core.h | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
|
|
Avoid `free(3)`ing invalid pointer
Fixes [Bug #17794]
---
addr2line.c | 2 ++
1 file changed, 2 insertions(+)
|
|
addr2line.c: DW_LNS_fixed_advance_pc takes a single uhalf operand
Fixes [Bug #17609]
Co-Authored-By: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
---
addr2line.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
undefine alloc functions for C extensions
per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:
- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
---
ext/objspace/objspace.c | 1 +
ext/socket/ifaddr.c | 1 +
2 files changed, 2 insertions(+)
|
|
[Bug #18117] Fix Ractor race condition with GC
rb_objspace_reachable_objects_from requires that the GC not be active.
Since the Ractor barrier is not executed for incremental sweeping,
Ractor may call rb_objspace_reachable_objects_from after sweeping
has started to share objects. This causes a crash that looks like
the following:
```
<internal:ractor>:627: [BUG] rb_objspace_reachable_objects_from() is not supported while during_gc == true
```
Co-authored-by: Vinicius Stock <vinicius.stock@shopify.com>
---
bootstraptest/test_ractor.rb | 15 +++++++++++++++
ractor.c | 12 ++++++++++--
2 files changed, 25 insertions(+), 2 deletions(-)
|
|
|
|
cd4f5b13228879d954fa97b6aa479c4a5ef4fb0a,8db269edb3550a85dfab9b193ea115ca36912ced,ab63f6d8543903f177c46634f38e5428655f003b: [Backport #18140]
Guard array when appending
This prevents early collection of the array. The GC doesn't see the
array on the stack when Ruby is compiled with optimizations enabled
[ruby-core:105099] [Bug #18140]
---
array.c | 1 +
test/ruby/test_array.rb | 6 ++++++
2 files changed, 7 insertions(+)
Guard array when appending
This prevents early collection of the array. The GC doesn't see the
array on the stack when Ruby is compiled with optimizations enabled
Thanks @jhaberman for the test case
[ruby-core:105099] [Bug #18140]
---
ext/-test-/array/concat/depend | 321 ++++++++++++++++++++++++++++++++
ext/-test-/array/concat/extconf.rb | 2 +
ext/-test-/array/concat/to_ary_conact.c | 64 +++++++
test/-ext-/array/test_to_ary_concat.rb | 20 ++
4 files changed, 407 insertions(+)
create mode 100644 ext/-test-/array/concat/depend
create mode 100644 ext/-test-/array/concat/extconf.rb
create mode 100644 ext/-test-/array/concat/to_ary_conact.c
create mode 100644 test/-ext-/array/test_to_ary_concat.rb
Refined test [Bug #18140]
---
ext/-test-/array/concat/to_ary_conact.c | 48 +++++++--------------------------
test/ruby/test_array.rb | 5 +++-
2 files changed, 13 insertions(+), 40 deletions(-)
|
|
Co-authored-by: nagachika <nagachika@ruby-lang.org>
|
|
d43279edacd09edf3a43e02d62f5be475e7c3bcb,5dc36ddcd00fc556c04c15ce9770c5a84d7d43dc,523bf31564f160f899f8cf9f73540d6a6f687f17: [Backport #18138]
Fix length calculation for Array#slice!
Commit 4f24255 introduced a bug which allows a length to be passed to
rb_ary_new4 which is too large, resulting in invalid memory access.
For example:
(1..1000).to_a.slice!(-2, 1000)
---
array.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Add out of range tests for Array#slice!
---
test/ruby/test_array.rb | 13 +++++++++++++
1 file changed, 13 insertions(+)
Add negative position tests [Bug #18138]
---
test/ruby/test_array.rb | 4 ++++
1 file changed, 4 insertions(+)
|
|
|
|
* Bundle RBS 1.4.0
* Bundle typeprof 0.15.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164f50dea918e7019847f578c3cffb079993d626,1985a3a77fac64cda177c74113a9348e36233630:"
This reverts commit 09d90c0ed861e74e58a59bc413bc39bcf9775db8.
|
|
164f50dea918e7019847f578c3cffb079993d626,1985a3a77fac64cda177c74113a9348e36233630:
Update TypeProf to 0.15.1
---
.github/workflows/ubuntu.yml | 2 +-
gems/bundled_gems | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Bundle RBS 1.4.0 & typeprof 0.15.2 (#4753)
* Bundle RBS 1.4.0
* Bundle typeprof 0.15.2
---
gems/bundled_gems | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
This fixes multiple bugs found in the partial backtrace
optimization added in 3b24b79.
These bugs occurs when passing a start argument to caller where
the start argument lands on a iseq frame without a pc.
Before this commit, the following code results in the same
line being printed twice, both for the #each method.
```
def a; [1].group_by { b } end
def b; puts(caller(2, 1).first, caller(3, 1).first) end
a
```
After this commit and in Ruby 2.7, the lines are different,
with the first line being for each and the second for group_by.
Before this commit, the following code can either segfault or
result in an infinite loop:
```
def foo
caller_locations(2, 1).inspect # segfault
caller_locations(2, 1)[0].path # infinite loop
end
1.times.map { 1.times.map { foo } }
```
After this commit, this code works correctly.
In terms of the implementation, this correctly skips iseq frames
without pc that occur before the number of frames the caller
requested to skip.
This rewrites the algorithm used for handling the partial
backtraces. It scans from the current frame outward to the
earliest frame, until it has found the desired number of frames.
It records that frame as the start frame. If needed, it continues
scanning backwards until arg->prev_cfp is set, as that is needed
to set the location of the first frame. Due to the fact that arg
is a void pointer, it's not possible to check this directly, but
this calls the iter_skip function in a situation where it knows
it will set arg->prev_cfp, and then breaks out of the loop.
Fixes [Bug #18053]
|
|
Stop force-recycling evacuated array [Bug #18065]
---
hash.c | 1 -
1 file changed, 1 deletion(-)
|
|
Prepend DebugSystem to VCS class only
And revert 24e5f1c982966c379220b1bbb26b4e0320180fa1, pepending to
Kernel did not affect the top level methods before 3.0.
---
tool/lib/vcs.rb | 3 ---
tool/make-snapshot | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
|
|
Ignore 7z unless available
`DebugSystem#system` is prepended in vcs.rb and defaulted to
`exception: true`.
---
tool/make-snapshot | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Avoid pointless attempts to open .so file if already required
When attempting to require a file without an extension that has
already been required or provided with an .so extension, only
look for files with an .rb extension. There is no point in
trying to find files with an .so extension, since we already
know one has been loaded.
Previously, attempting to require such a file scanned the load
path twice, once for .rb and once for .so. Now it only scans
once for .rb. The scan once for .rb cannot be avoided, since
the .rb file would take precedence and should be loaded if it
exists.
Fixes [Bug #10902]
---
load.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
Sort feature index arrays by the priority of file types [Bug #15856]
When looking for libraries to load with a feature name without
extension, `.rb` files are given priority. However, since the
feature index arrays were not in that order of priority, but in
the order in which they were loaded, a lower priority extension
library might be returned. In that case, the `.rb` file had to be
searched for again from the `$LOAD_PATH`, resulting in poor
performance.
---
load.c | 52 +++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 45 insertions(+), 7 deletions(-)
|
|
8897098b5ca3ce987307d1799f7765e6a279ff0d,d04ba0906c35013a8432535168eec270d6e9a913:
Update bundled_gems to pass test-bundled-gems on macOS.
---
gems/bundled_gems | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Update bundled_gems
---
gems/bundled_gems | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Fixed leaked global symbols
---
gc.c | 14 +++++++++-----
vm_insnhelper.c | 7 ++++---
vm_insnhelper.h | 2 +-
vm_sync.c | 4 ++--
vm_sync.h | 6 ++++--
5 files changed, 20 insertions(+), 13 deletions(-)
|
|
73cd4951de20bf989747013b1e62a202f12ac2d2,6e6be107dd0c820afc4db68d09110ad96c4aebdd:
Reduced GitHub Actions
Moved leaked-globals before check.
---
.github/workflows/macos.yml | 4 +++-
.github/workflows/ubuntu.yml | 8 +++-----
2 files changed, 6 insertions(+), 6 deletions(-)
Ignore test-bundled-gems on GitHub Actions because matrix tests has
unknown issues
---
.github/workflows/macos.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
[Backport #17666]
Co-authored-by: Samuel Williams <@ioquatix>
https://github.com/nagachika/ruby/pull/1/commits/2cee515f024f3295945f312cb6b052f972f9c93d
|
|
|
|
|
|
|
|
119697f61e2b2b157816a8aa33aada5863959900,4a627dbdfd1165022fa9e716ba845e937b03773d: [Backport #18014]
[Bug #18014] Fix rb_gc_force_recycle unmark before sweep
If we force recycle an object before the page is swept, we should clear
it in the mark bitmap. If we don't clear it in the bitmap, then during
sweeping we won't account for this free slot so the `free_slots` count
of the page will be incorrect.
---
gc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Bug #18014] Fix memory leak in GC when using Ractors
When a Ractor is removed, the freelist in the Ractor cache is not
returned to the GC, leaving the freelist permanently lost. This commit
recycles the freelist when the Ractor is destroyed, preventing a memory
leak from occurring.
---
gc.c | 116 +++++++++++++++++++++++++++-------------------------------
internal/gc.h | 6 +++
ractor.c | 3 ++
ractor_core.h | 5 +--
4 files changed, 64 insertions(+), 66 deletions(-)
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
|
|
25e56fe374478a2266ac25f22a07bb3c6a423c83,8758b07b1e4fd636dffb4b442388a3033c63d4b5,791e8eec66d3aebcee36c1369b0bf52bc3815e94: [Backport #18016]
[ruby/fiddle] Fix Win32Types for Windows 64-bit (#63)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
https://github.com/ruby/fiddle/commit/28ee5b1608
---
ext/fiddle/lib/fiddle/types.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[ruby/fiddle] Fix more Win32Types definitions
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
https://github.com/ruby/fiddle/commit/805c1a595a
---
ext/fiddle/lib/fiddle/types.rb | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
[ruby/fiddle] win32types: sort
https://github.com/ruby/fiddle/commit/35dec6c5a5
---
ext/fiddle/lib/fiddle/types.rb | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
|
|
391abc543cea118a9cd7d6310acadbfa352668ef,e86c1f6fc53433ef5c82ed2b7a4cc9a12c153e4c,f6539202c52a051a4e6946a318a1d9cd29002990: [Backport #12052]
Scan the coderange in the given encoding
---
ext/-test-/string/enc_str_buf_cat.c | 14 ++++++++++++++
string.c | 32 ++++++++++++++++++++++---------
test/-ext-/string/test_enc_str_buf_cat.rb | 9 +++++++++
3 files changed, 46 insertions(+), 9 deletions(-)
Work around issue transcoding issue with non-ASCII compatible
encodings and xml escaping
When using a non-ASCII compatible source and destination encoding
and xml escaping (the :xml option to String#encode), the resulting
string was broken, as it used the correct non-ASCII compatible
encoding, but contained data that was ASCII-compatible instead of
compatible with the string's encoding.
Work around this issue by detecting the case where both the
source and destination encoding are non-ASCII compatible, and
transcoding the source string from the non-ASCII compatible
encoding to UTF-8. The xml escaping code will correctly handle
the UTF-8 source string and the return the correctly encoded
and escaped value.
Fixes [Bug #12052]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
---
test/ruby/test_transcode.rb | 19 +++++++++++++++++++
transcode.c | 6 ++++++
2 files changed, 25 insertions(+)
=?UTF-8?q?-=20add=20regression=20tests=20for=20U+6E7F=20(?=
=?UTF-8?q?=E6=B9=BF)=20in=20ISO-2022-JP?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In ISO-2022-JP, the bytes use to code are the same as those for "<>".
This adds regression tests to make sure that these bytes, when representing
湿, are NOT escaped with encode("ISO-2022-JP, xml: :text) or similar.
These are additional regression tests for #12052.
---
test/ruby/test_transcode.rb | 3 +++
1 file changed, 3 insertions(+)
|
|
skip marking for uninitialized imemo_env.
RUBY_INTERNAL_EVENT_NEWOBJ can expose uninitialized imemo_env
objects and marking it will cause critical error. This patch
skips marking on uninitialized imemo_env.
See: http://rubyci.s3.amazonaws.com/centos7/ruby-master/log/20210329T183003Z.fail.html.gz
Shortest repro-code is provided by mame-san.
---
gc.c | 16 ++++++++++------
test/objspace/test_objspace.rb | 13 +++++++++++++
2 files changed, 23 insertions(+), 6 deletions(-)
|
|
|
|
|
|
This fixes CVE-2021-32066.
Reported by Alexandr Savca in <https://hackerone.com/reports/1178562>.
|
|
|
|
This fixes CVE-2021-31810.
Reported by Alexandr Savca.
Co-authored-by: Shugo Maeda <shugo@ruby-lang.org>
|
|
|
|
|
|
|