summaryrefslogtreecommitdiff
path: root/version.h
AgeCommit message (Collapse)Author
2021-11-24 Fix integer overflowv3_0_3nagachika
Make use of the check in rb_alloc_tmp_buffer2. https://hackerone.com/reports/1328463 When parsing cookies, only decode the values Bump version Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2021-11-24Bump patchlevel.nagachika
2021-11-24merge revision(s) ↵nagachika
f367b4ffe739453e87e55f955138b0ce662942b7,31a757a4426f1ac8c479313e01542940386fc2fe,837cbea64b74d464bfbfb10e6c81a8f92c6eee71: assert_equal accepts an expected value as the first argument --- test/psych/test_coder.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) Make the test pass with the old libyaml I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway. --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) test/psych/test_coder.rb: Suppress non-parenthesis warnings http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ``` --- test/psych/test_coder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
2021-11-24merge revision(s) ↵nagachika
e1b03b0c2b2449a7794f4701bab8b2382eb15116,007e439fe965871c73127928f7244ebb96a86e58: Enable VM_ASSERT in --jit CIs (#4543) --- .github/workflows/mjit.yml | 2 +- ractor.c | 6 +++--- vm_core.h | 6 +++--- vm_method.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) Do not expect ec on rb_vm_bugreport because a SEGV might happen on an MJIT worker. As you can clearly see from `if (vm && ec) {`, ec is not guaranteed to exist here. --- vm_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-11-23merge revision(s) ↵nagachika
5680c38c75aeb5cbd219aafa8eb48c315f287d97,f5d20411386ff2552ff27661387ddc4bae1ebc30: [Backport #17573] Use valid `ec` for postponed job. Postponed job can be registered from non-Ruby thread, which means `ec` in TLS can be NULL. In this case, use main thread's `ec` instead. See https://github.com/ruby/ruby/pull/4108 and https://github.com/ruby/ruby/pull/4336 --- vm_trace.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) Avoid assert failure when NULL EC is expected After 5680c38c75aeb5cbd219aafa8eb48c315f287d97, postponed job APIs now expect to be called on native threads not managed by Ruby and handles getting a NULL execution context. However, in debug builds the change runs into an assertion failure with GET_EC() which asserts that EC is non-NULL. Avoid the assertion failure by passing `false` for `expect_ec` instead as the intention is to handle when there is no EC. Add a test from John Crepezzi and John Hawthorn to exercise this situation. See GH-4108 See GH-5094 [Bug #17573] Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: John Crepezzi <john.crepezzi@gmail.com> --- ext/-test-/postponed_job/postponed_job.c | 31 ++++++++++++++++++++++++++ test/-ext-/postponed_job/test_postponed_job.rb | 7 ++++++ vm_trace.c | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-)
2021-11-23merge revision(s) e83c02a768af61cd0890a75e90bcae1119d8bd93: [Backport #18289]nagachika
Delegate keywords from Enumerable#to_a to #each Fixes [Bug #18289] --- enum.c | 2 +- test/ruby/test_enum.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
2021-11-23merge revision(s) 84202963c52e02cecad3e6b2fad478bfbeee1bc7: [Backport #18329]nagachika
[Bug #18329] Fix crash when calling non-existent super method The cme is NULL when a method does not exist, so check it before accessing the callcache. --- test/ruby/test_super.rb | 31 +++++++++++++++++++++++++++++++ vm_insnhelper.c | 3 ++- 2 files changed, 33 insertions(+), 1 deletion(-)
2021-11-22* 2021-11-22 [ci skip]git
2021-11-06merge revision(s) d0a05fd4b40ff0f88728c4897e67b68185128f54:nagachika
Fixed FD leaks --- test/socket/test_tcp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-11-06merge revision(s) a4d5ee4f31bf3ff36c1a8c8fe3cda16aa1016b12: [Backport #18264]nagachika
[Bug #18264] Fix memory leak in TracePoint TracePoint leaks memory because it allocates a `rb_tp_t` struct without ever freeing it (it is created with `RUBY_TYPED_NEVER_FREE`). --- test/ruby/test_settracefunc.rb | 10 ++++++++++ vm_trace.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
2021-10-31test_gc.rb: relax criterionnagachika
2021-10-30Bump patchlevel.nagachika
2021-10-30Bump patchlevel.nagachika
2021-10-30* 2021-10-30 [ci skip]git
2021-10-16merge revision(s) 76228191474c76810043b294a74bbb2f1808b3d9: [Backport #18023]nagachika
Fix Ractor.make_shareable changing locals for Procs env_copy() uses rb_ary_delete_at() with a loop counting up while iterating through the list of read only locals. rb_ary_delete_at() can shift elements in the array to an index lesser than the loop index, causing locals to be missed and set to Qfalse in the returned environment. Iterate through the locals in reverse instead, this way the shifting never happens for locals that are yet to be visited and we process all the locals in the array. [Bug #18023] --- bootstraptest/test_ractor.rb | 22 ++++++++++++++++++++++ vm.c | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-)
2021-10-16merge revision(s) 217df51f0e5d9824ed712a4d175f555d932e44d8: [Backport #18232]nagachika
Dump outer variables tables when dumping an iseq to binary 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] --- compile.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- test/ruby/test_iseq.rb | 10 +++++++++ 2 files changed, 64 insertions(+), 1 deletion(-)
2021-10-09merge revision(s) abc0304cb28cb9dcc3476993bc487884c139fd11: [Backport #17507]nagachika
Avoid race condition in Regexp#match 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] --- re.c | 46 +++++++++++++++++++--------------------------- test/ruby/test_regexp.rb | 21 +++++++++++++++++++++ 2 files changed, 40 insertions(+), 27 deletions(-)
2021-10-09merge revision(s) ↵nagachika
60d0421ca861944459f52292d65dbf0ece26e38a,b6534691a16d751d59fc572d5dddebcaeb21f007,409dbc951b9875d27bd73748c88e15386473cffb,842b0008c132dd587f09766a228041afb7fed24f: [Backport #18191] Fix the encoding of loaded feature names [Bug #18191] The feature names loaded from the default load paths should also be in the file system encoding. --- ruby.c | 12 +++++++++++- test/ruby/test_require.rb | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) Copy path strings as interned strings --- ruby.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) Replace expanded load path only when modified --- ruby.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Skip broken strings as the locale encoding --- internal/string.h | 1 + ruby.c | 11 +++++++---- string.c | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-)
2021-10-09merge revision(s) ↵nagachika
89242279e61b023a81c58065c62a82de8829d0b3,529fc204af84f825f98f83c34b004acbaa802615: [Backport #18141] Marshal.load: do not call the proc until strings have their encoding Ref: https://bugs.ruby-lang.org/issues/18141 --- marshal.c | 7 +++- spec/ruby/core/marshal/shared/load.rb | 62 +++++++++++++++++++++++------------ test/ruby/test_marshal.rb | 17 ++++++++++ 3 files changed, 64 insertions(+), 22 deletions(-) marshal.c: don't call the proc with partially initialized objects. (#4866) For cyclic objects, it requires to keep a st_table of the partially initialized objects. --- marshal.c | 75 ++++++++++++++++++++--------------- spec/ruby/core/marshal/shared/load.rb | 75 ++++++++++++++++++++--------------- test/ruby/test_marshal.rb | 12 ++++++ 3 files changed, 97 insertions(+), 65 deletions(-)
2021-10-03merge revision(s) ↵nagachika
7c0230b05d0978958f89434c84ddd9c82419c1a5,552728a23aeab0df598b356b19a573259e297d14,49af9012a20a824542cf588e55e5488895553e09: [Backport #18184] Check the entire name as `ruby2_keywords_flag` [Bug #18184] --- marshal.c | 2 +- test/ruby/test_marshal.rb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) Check the encoding of `ruby2_keywords_flag` [Bug #18184] --- marshal.c | 1 + test/ruby/test_marshal.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) Prohibit invalid encoding symbols [Bug #18184] --- marshal.c | 8 +++++++- test/ruby/test_marshal.rb | 10 +++++++--- 2 files changed, 14 insertions(+), 4 deletions(-)
2021-10-03merge revision(s) ddb32e66160ab50849419ef7c7ac584913b79c34: [Backport #18173]nagachika
[Bug #18173] Update loaded_features_index 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. --- load.c | 1 + test/ruby/test_require.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+)
2021-10-02merge revision(s) fa05697e4832fbd67a4f91b9bb362471902faab3: [Backport #18166]nagachika
Use `%printer` directive for Bison 3.8 --- parse.y | 74 ++++++++++++++++++++++++++--------------------------------------- 1 file changed, 29 insertions(+), 45 deletions(-)
2021-09-26* 2021-09-26 [ci skip]git
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-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-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-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