summaryrefslogtreecommitdiff
path: root/version.h
AgeCommit message (Collapse)Author
2021-04-05teenyupNARUSE, Yui
2021-04-05* 2021-04-05 [ci skip]git
2021-04-03* 2021-04-03 [ci skip]git
2021-04-02merge revision(s) 0a544c0c35f7445d69402d7c53d825384c728017: [Backport #17754]NARUSE, Yui
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(-)
2021-04-02merge revision(s) f9f13a4f6d8be706b17efc089c28f7bc617ef549: [Backport #17746]NARUSE, Yui
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(-)
2021-04-02merge revision(s) 7e8a9af9db42a21f6a1125a29e98c45ff9d5833b: [Backport #17732]NARUSE, Yui
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(-)
2021-04-02merge revision(s) a85ed626f18d1014d09fb37eb0a703976c3d2b53: [Backport #17731]NARUSE, Yui
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(-)
2021-04-02merge revision(s) f748b911c9157a0bb86f38280ddfba72a55049b6: [Backport #17729]NARUSE, Yui
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(-)
2021-04-02merge revision(s) 58660e943488778563b9e41005a601e9660ce21f: [Backport #17519]NARUSE, Yui
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(-)
2021-03-24* 2021-03-24 [ci skip]git
2021-03-14merge revision(s) ↵NARUSE, Yui
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(-)
2021-03-13merge revision(s) f6d5de8f33fe715d939e3e77b8ef73d88bcd6c9f: [Backport #17659]NARUSE, Yui
[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
2021-03-13merge revision(s) b3c53a8a885be8f5cc2b712798b0d2741c488ce4: [Backport #17672]NARUSE, Yui
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(-)
2021-03-13merge revision(s) ↵NARUSE, Yui
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(-)
2021-03-13* 2021-03-13 [ci skip]git
2021-03-12merge revision(s) 7b9476fbfab738d1eb01b4b4c4af9a1680513019: [Backport #17642]NARUSE, Yui
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(+)
2021-03-11merge revision(s) 07ab172ebef28bb82c2650694548d123802d6c22: [Backport #17636]NARUSE, Yui
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(-)
2021-03-11merge revision(s) ↵NARUSE, Yui
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(-)
2021-03-11merge revision(s) 2a83650b0fd25719fb6c03bfec7bd895734d3ceb: [Backport #15852]NARUSE, Yui
Destroy VM-wise locks before freeing [Bug #15852] --- thread.c | 7 ------- vm.c | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-)
2021-03-11* 2021-03-11 [ci skip]git
2021-03-03merge revision(s) ↵NARUSE, Yui
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(-)
2021-03-03* 2021-03-03 [ci skip]git
2021-03-02merge revision(s) ↵NARUSE, Yui
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(-)
2021-03-02merge revision(s) 87437326214e4587a41946c8937e11418d983acd: [Backport #17581]NARUSE, Yui
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(-)
2021-03-02merge revision(s) b94b7965c420661ed621c146a4efaf43bc3cf50b: [Backport #17639]NARUSE, Yui
Fixed fallback ENABLE_VIRTUAL_TERMINAL_PROCESSING value [Bug #17639] --- ruby.c | 2 +- win32/win32.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
2021-03-02merge revision(s) 5de38c41ae7bf17ae599fdfa9f8face87f16d8bb: [Backport #17644]NARUSE, Yui
ripper: fix a bug of Ripper::Lexer with syntax error and heredoc [Bug #17644] --- ext/ripper/lib/ripper/lexer.rb | 2 +- test/ripper/test_lexer.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
2021-03-02merge revision(s) 265c0022390e3dcd4ff692fc77d29b94e652c877: [Backport #17653]NARUSE, Yui
Do not allocate ractor-local storage in dfree function during GC --- random.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
2021-03-02merge revision(s) 15dbaa0b54f10e43976d594ef987da5f51e0c7c1: [Backport #17622]NARUSE, Yui
[Fixes #17622] Mark and move the previous ep --- vm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
2021-02-26* 2021-02-26 [ci skip]git
2021-02-16merge revision(s) a681c484a3c5b9235c84bc5c253b4406e498e8cf: [Backport #17626]NARUSE, Yui
Fixed codepage for utime [Bug #17626] Should use the given codepage argument. Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org> --- test/ruby/test_file_exhaustive.rb | 7 +++++++ win32/win32.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-)
2021-02-16merge revision(s) 49d3830f44031174ad450a0ea1cdcdf0eabf9d0e: [Backport #17560]NARUSE, Yui
Fix documentation for Module#ruby2_keywords It returns nil, not self. Fixes [Bug #17560] --- vm_method.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-02-09* 2021-02-09 [ci skip]git
2021-02-08merge revision(s) ↵NARUSE, Yui
6f727853cee41195b67ee5d793c1ac23fe1a6ae0,b2674c1fd725b43adf51af7935c780359d70c2a4: [Backport #17482] only main thread can modify vm->ubf_async_safe vm->ubf_async_safe is VM global resource and only main thread can manipulate it. [Bug #17482] --- thread.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) unblock thread is only for main ractor. other ractors should not have a unblock thread. This patch fixes 6f727853cee41195b67ee5d793c1ac23fe1a6ae0. --- thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
2021-02-07* 2021-02-07 [ci skip]git
2021-02-03merge revision(s) 0e5fbec81632968836da06dc50fca4948cae6d30: [Backport #17603]NARUSE, Yui
Fixed varargs in `rb_bug_without_die` [Bug #17603] --- error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
2021-02-03merge revision(s) ↵NARUSE, Yui
598b7988f4f332c2d974bde6bc8be299150e2dce,4a06cb31170789f6fc0b1ce069bccab9d731c8bf: [Backport #17604] Bundle RBS 1.0.4 (#4136) --- gems/bundled_gems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Update TypeProf to 0.12.0 (#4132) --- gems/bundled_gems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
2021-02-02merge revision(s) 739f929:NARUSE, Yui
NetBSD build update. (#4079) --- addr2line.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
2021-02-02merge revision(s) 1cdae49d39fbaef654df487f168d1fb14a146d59: [Backport #17577]NARUSE, Yui
Implement NameError::message#clone for Ractor --- bootstraptest/test_ractor.rb | 13 +++++++++++++ error.c | 35 +++++++++++++++++++++++++++++++++-- test/objspace/test_objspace.rb | 9 +++++++++ 3 files changed, 55 insertions(+), 2 deletions(-)
2021-02-02merge revision(s) b091889ed67f278b1652ddde88596e2160d5aef0: [Backport #17582]NARUSE, Yui
Removed YYUSE [Bug #17582] Although it was used just to suppress an "unsed argument" warning in the same manner as other bison-provided functions, it has been dropped since Bision 3.7.5. And we always suppress that warnings. --- parse.y | 1 - 1 file changed, 1 deletion(-)
2021-02-02merge revision(s) 9241211538189a58b477bd55b539357617fd42ed: [Backport #17589]NARUSE, Yui
Forward keyword arguments for Pathname#each_line [Bug #17589] --- ext/pathname/pathname.c | 4 ++-- test/pathname/test_pathname.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-)
2021-02-02merge revision(s) 1b89b99941548fdb65305dd9a412082e7fdba45a: [Backport #17534]NARUSE, Yui
Mark pattern labels as unremoveable Peephole optimization doesn't play well with find pattern at least. The only case when a pattern matching could have unreachable patterns is when we have lasgn/dasgn node, which shouldn't happen in real-life. Fixes https://bugs.ruby-lang.org/issues/17534 --- compile.c | 2 +- test/ruby/test_pattern_matching.rb | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
2021-02-02merge revision(s) 8dfae85adb96cf3da84bf38f2103969d4a7aed3f: [Backport #17575]NARUSE, Yui
Warn the defined location as deprecation as well as the main message [Bug #17575] --- test/ruby/test_defined.rb | 17 +++++++++++++++++ vm_method.c | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-)
2021-02-02merge revision(s) ↵NARUSE, Yui
9efd590a13d1e8b8a141c46eabb48c2a1c286d2b,a55eb9a2af7950d180d9d31ffde2bce66710f44f: [Backport #17572] Rationalize floats in coerce [Bug #17572] --- rational.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) Make reciprocal properly of non-integral rational [Bug #17572] --- rational.c | 2 +- test/ruby/test_rational.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
2021-02-02merge revision(s) 6ca3d1af3302f722aed530764d07c1cc83e95ecf: [Backport #17552]NARUSE, Yui
objspace_dump.c: Handle allocation path and line missing --- ext/objspace/objspace_dump.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
2021-02-02merge revision(s) eeacdcb9a073c7d8ad703e0dc9faf229a5ebbe3c: [Backport #17558]NARUSE, Yui
Fixed premature return After setting ruby2_keywords for bmethod, the rest of arguments had been ignored. [Bug #17558] --- test/ruby/test_keyword.rb | 9 +++++++++ vm_method.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-)
2021-02-02* 2021-02-02 [ci skip]git
2021-02-01merge revision(s) e033c9d7db0: [Backport #17549]NARUSE, Yui
Include missing AvailabilityMacros.h --- random.c | 4 ++++ 1 file changed, 4 insertions(+)
2021-02-01merge revision(s) b84b253a69537a14e4854e17b6d94ae75c2af050: [Backport #17547]NARUSE, Yui
Fix Ripper with heredoc. --- ext/ripper/lib/ripper/lexer.rb | 1 + test/ripper/test_lexer.rb | 10 ++++++++++ 2 files changed, 11 insertions(+)
2021-02-01merge revision(s) 0ed71b37fa9af134fdd5a7fd1cebd171eba83541: [Backport #17536]NARUSE, Yui
Don't try to clear cache on garbage objects Method cache can be cleared during lazy sweeping. An object that will be collected during lazy sweep *should not* have it's method cache cleared. Soon-to-be-collected objects can be in an inconsistent state and this can lead to a crash. This patch just leaves early if the object is going to be collected. Fixes [Bug #17536] Co-Authored-By: John Hawthorn <john@hawthorn.email> Co-Authored-By: Alan Wu <XrXr@users.noreply.github.com> --- vm_method.c | 1 + 1 file changed, 1 insertion(+)
2021-02-01merge revision(s) ↵NARUSE, Yui
efcdf68e6443ab70fbff1703b9dabbfc5090df31,5e26619660f20272a53c7f839dde36cce034bb35: [Backport #17539] Guard callinfo Callinfo was being written in to an array and the GC would not see the reference on the stack. `new_insn_send` creates a new callinfo object, then it calls `new_insn_core`. `new_insn_core` allocates a new INSN linked list item, which can end up calling `xmalloc` which will trigger a GC: https://github.com/ruby/ruby/blob/70cd351c7c71c48ee18d7c01e851a89614086f8f/compile.c#L968-L969 Since the callinfo object isn't on the stack, the GC won't see it, and it can get collected. This patch just refactors `new_insn_send` to keep the object on the stack Co-authored-by: John Hawthorn <john@hawthorn.email> --- compile.c | 7 +++++-- test/ruby/test_gc.rb | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) Fix WB for callinfo The WB for callinfo needs to be executed *after* the reference is written. Otherwise we get a WB miss. --- compile.c | 1 + 1 file changed, 1 insertion(+)