summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-18merge revision(s) bb84c75001f1bf13b4b2a12db8f4420e76a3ea03: [Backport #17735]nagachika
Revert "Force recycle intermediate collection in Hash#transform_keys! [Bug #17735]" This reverts commit 522d4cd32f7727886f4fcbc28ed29c08d361ee20. --- hash.c | 1 - 1 file changed, 1 deletion(-)
2021-09-18merge revision(s) 99d8c4832a7133ca52578d015e3ddcfd94820f4a: [Backport #18160]nagachika
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(-)
2021-09-18merge revision(s) 564ccd095a9d7fbe869031dbf666d61dadfdcb03: [Backport #17756]nagachika
[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(-)
2021-09-18merge revision(s) 13939d61b4b69bd109c5f41303c79868d639fa44: [Backport #17661]nagachika
Check if closed after each yield [Bug #17661] --- io.c | 4 +++- test/ruby/test_io.rb | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-)
2021-09-11merge revision(s) 5d815542815fe8b939239750bba7f8f0b79c97d6: [Backport #18154]nagachika
[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(-)
2021-09-11merge revision(s) f336a3eb6c76890f3d8f878725b3d328c8fdcf33: [Backport #18126]nagachika
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(-)
2021-09-11merge revision(s) d795f494a89e0d9498dfedc54b8a98acc2bc4d7b: [Backport #17794]nagachika
Avoid `free(3)`ing invalid pointer Fixes [Bug #17794] --- addr2line.c | 2 ++ 1 file changed, 2 insertions(+)
2021-09-05merge revision(s) 7d22060c14895bbca3ff962e5456384095b66738: [Backport #17609]nagachika
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(-)
2021-09-05merge revision(s) c0f4e4ca6d0f76985bca79314b232b787c8f008e: [Backport #18007]nagachika
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(+)
2021-09-05merge revision(s) bbedd29b6e98ef6e3fc2ce2b358d2b509b7cd1bb: [Backport #18117]nagachika
[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(-)
2021-09-05add dependency for ext/-test-/array/concat/to_ary_conact.cnagachika
2021-09-05merge revision(s) ↵nagachika
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(-)
2021-09-05Backport mutexes for socket and connection lists on win32 #4212 (#4218)Andrew Aladjev
Co-authored-by: nagachika <nagachika@ruby-lang.org>
2021-08-29merge revision(s) ↵nagachika
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(+)
2021-08-19Bump patchlevel.nagachika
2021-08-19Bundle RBS 1.4.0 & typeprof 0.15.2 (#4753)Soutaro Matsumoto
* Bundle RBS 1.4.0 * Bundle typeprof 0.15.2
2021-08-19Update TypeProf to 0.15.1Yusuke Endoh
2021-08-19Merge RubyGems 3.2.26 and Bundler 2.2.26Hiroshi SHIBATA
2021-08-19Merge RubyGems 3.2.25 and Bundler 2.2.25Hiroshi SHIBATA
2021-08-19Merge RubyGems 3.2.24 and Bundler 2.2.24Hiroshi SHIBATA
2021-08-19Merge RubyGems 3.2.23 and Bundler 2.2.23Hiroshi SHIBATA
2021-08-19* 2021-08-19 [ci skip]git
2021-08-19Revert "merge revision(s) ↵nagachika
164f50dea918e7019847f578c3cffb079993d626,1985a3a77fac64cda177c74113a9348e36233630:" This reverts commit 09d90c0ed861e74e58a59bc413bc39bcf9775db8.
2021-08-19merge revision(s) ↵nagachika
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(-)
2021-08-08Bump patchlevel.nagachika
2021-08-08Fix multiple bugs in partial backtrace optimizationJeremy Evans
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]
2021-08-08merge revision(s) e5dd40b1f3a11f48d566413ab347ce0cfdd94960: [Backport #18065]nagachika
Stop force-recycling evacuated array [Bug #18065] --- hash.c | 1 - 1 file changed, 1 deletion(-)
2021-08-04merge revision(s) b8386f7f7f6d7a7d76481e02d389d0f5211f0f2c:nagachika
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(-)
2021-08-01merge revision(s) 24e5f1c982966c379220b1bbb26b4e0320180fa1:nagachika
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(-)
2021-08-01merge revision(s) 345db8f2aa373a31c619c8f85bd372f0a20829c1: [Backport #10902]nagachika
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(-)
2021-08-01merge revision(s) b360588cd3cbac5fb4f004aa53a8fdc715906719: [Backport #15856]nagachika
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(-)
2021-07-29merge revision(s) ↵nagachika
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(-)
2021-07-25merge revision(s) 292230cbf926e9892596ea37fd4567f0c49ab73c:nagachika
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(-)
2021-07-25merge revision(s) ↵nagachika
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(-)
2021-07-25partially merge revision(s) 5f69a7f60467fa58c2f998daffab43e118bff36c: ↵nagachika
[Backport #17666] Co-authored-by: Samuel Williams <@ioquatix> https://github.com/nagachika/ruby/pull/1/commits/2cee515f024f3295945f312cb6b052f972f9c93d
2021-07-25bump up bundled rbs and typeprof version to pass test-bundled-gems.nagachika
2021-07-25bump up bundled rbs and typeprof version to pass test-bundled-gems.nagachika
2021-07-22* 2021-07-22 [ci skip]git
2021-07-22partially merge revision(s) ↵nagachika
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>
2021-07-18merge revision(s) ↵nagachika
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(-)
2021-07-18merge revision(s) ↵nagachika
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(+)
2021-07-18merge revision(s) 1fac99afdae2671a9ca86bead5bde4d0e2eff1b4: [Backport #18030]nagachika
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(-)
2021-07-07bump teeny version to 3.0.3.nagachika
2021-07-07bump up RUBY_PATCHLEVELv3_0_2nagachika
2021-07-07Fix StartTLS stripping vulnerabilityShugo Maeda
This fixes CVE-2021-32066. Reported by Alexandr Savca in <https://hackerone.com/reports/1178562>.
2021-07-07bump up RUBY_PATCHLEVELnagachika
2021-07-07Ignore IP addresses in PASV responses by default, and add new option use_pasv_ipYusuke Endoh
This fixes CVE-2021-31810. Reported by Alexandr Savca. Co-authored-by: Shugo Maeda <shugo@ruby-lang.org>
2021-07-07* 2021-07-07 [ci skip]git
2021-07-07Merge RubyGems-3.2.22 and Bundler-2.2.22Hiroshi SHIBATA
2021-07-07Merge RubyGems-3.2.21 and Bundler-2.2.21Hiroshi SHIBATA