Age | Commit message (Collapse) | Author |
|
This should help in debugging the intermittent test failures on CI:
TestProcess#test_warmup_frees_pages [test/ruby/test_process.rb:2779]:
<201> expected but was
<202>.
|
|
https://github.com/rubygems/rubygems/commit/7d2c4cf364
|
|
* Update reline-0.5.7
* Update irb-1.13.1
|
|
[Bug #20307] Fix `Hash#update` to make frozen copy of string keys
|
|
Sometimes this file get picked up and break Ripper tests:
TestRipper::Generic#test_parse_files:test/ruby
assert_separately failed with error message
pid 63392 exit 0
| test_regexp.rb:2025: warning: character class has duplicated range
https://github.com/ruby/ruby/actions/runs/7699956651/job/20982702553#step:12:103
|
|
without second.
This commit fixes the following errors in the tests.
Because the OpenSSL project changed the code to make the time string format
without second invalid. So, we drop the assertions.
```
1) Error: test_generalizedtime(OpenSSL::TestASN1): OpenSSL::ASN1::ASN1Error: generalizedtime is too short
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode'
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode_test'
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:433:in `test_generalizedtime'
430: OpenSSL::ASN1::GeneralizedTime.new(Time.utc(9999, 9, 8, 23, 43, 39))
431: # LibreSSL 3.6.0 requires the seconds element
432: return if libressl?
=> 433: decode_test B(%w{ 18 0D }) + "201612081934Z".b,
434: OpenSSL::ASN1::GeneralizedTime.new(Time.utc(2016, 12, 8, 19, 34, 0))
435: # not implemented
436: # decode_test B(%w{ 18 13 }) + "https://github.com/ruby/openssl/commit/201612081934+0930".b,
2) Error: test_utctime(OpenSSL::TestASN1): OpenSSL::ASN1::ASN1Error: utctime is too short
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode'
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:698:in `decode_test'
/home/runner/work/ruby-openssl/ruby-openssl/test/openssl/test_asn1.rb:411:in `test_utctime'
408: end
409: # Seconds is omitted. LibreSSL 3.6.0 requires it
410: return if libressl?
=> 411: decode_test B(%w{ 17 0B }) + "1609082343Z".b,
412: OpenSSL::ASN1::UTCTime.new(Time.utc(2016, 9, 8, 23, 43, 0))
413: # not implemented
414: # decode_test B(%w{ 17 11 }) + "https://github.com/ruby/openssl/commit/500908234339+0930".b,
```
https://github.com/ruby/openssl/commit/2e826d5715
|
|
OpenSSL 3.3.0 9 Apr 2024 is also broken.
Signed-off-by: Xi Ruoyao <[email protected]>
https://github.com/ruby/net-http/commit/ab525c956d
|
|
* Merge RubyGems-3.5.6 and Bundler-2.5.6
* Merge RubyGems-3.5.7 and Bundler-2.5.7
* Merge RubyGems-3.5.8 and Bundler-2.5.8
* Partly reverted about https://github.com/rubygems/rubygems/pull/7483
* Merge RubyGems-3.5.9 and Bundler-2.5.9
|
|
#20324] (#10329)
[Bug #20324] Uncomparable ranges are not overlapping
|
|
e626da82eae3d437b84d4f9ead0164d436b08e1a,f3af5ae7e6c1c096bbfe46d69de825a02b1696cf: [Backport #20311] (#10312)
Don't pin named structs defined in Ruby
[Bug #20311]
`rb_define_class_under` assumes it's called from C and that the
reference might be held in a C global variable, so it adds the
class to the VM root.
In the case of `Struct.new('Name')` it's wasteful and make
the struct immortal.
Make Struct memory leak test faster
[Bug #20311]
It times out on some platform, so we can reduce iterations.
On my machine it completes in 250ms and RSS grows 8X.
|
|
081ee3d35509110f383cb7dd8d1205def0cdd1e8,1c97abaabae6844c861705fd07f532292dcffa74: [Backport #19907] (#10315)
Add memory leak test for eval kwargs
De-dup identical callinfo objects
Previously every call to vm_ci_new (when the CI was not packable) would
result in a different callinfo being returned this meant that every
kwarg callsite had its own CI.
When calling, different CIs result in different CCs. These CIs and CCs
both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop
this resulted in a memory leak of both types of object. This also likely
resulted in extra memory used, and extra time searching, in non-eval
cases.
For simplicity in this commit I always allocate a CI object inside
rb_vm_ci_lookup, but ideally we would lazily allocate it only when
needed. I hope to do that as a follow up in the future.
|
|
#20327] (#10313)
[Bug #20327] Do not count subsecond to calculate UTC offset
Assume that there will never be any time zones with UTC offsets that
are subseconds. Historically, UTC offset has only been used down to
the second.
|
|
d19d683a354530a27b4cbb049223f8dc70c75849,de1a586ecc2ee7f465f0c0a69291054136a3a819: [Backport #20250] (#10308)
rb_obj_setup: do not copy RUBY_FL_SEEN_OBJ_ID
[Bug #20250]
We're seting up a new instance, so it never had an associated
object_id.
proc.c: get rid of `CLONESETUP`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[Bug #20253]
All the way down to Ruby 1.9, `Proc`, `Method`, `UnboundMethod`
and `Binding` always had their own specific clone and dup routine.
This caused various discrepancies with how other objects behave
on `dup` and `clone. [Bug #20250], [Bug #20253].
This commit get rid of `CLONESETUP` and use the the same codepath
as all other types, so ensure consistency.
NB: It's still not accepting the `freeze` keyword argument on `clone`.
Co-Authored-By: Étienne Barrié <[email protected]>
|
|
18ee7c9a108bf3424814565377c8796e5e455cf7,4a6384ed9358e8fb8464f6e37efb5477182f01db: [Backport #20246] (#10309)
Clear all refined CCs on reopening refinement mod
In cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 we started using inline
caches for refinements. However, we weren't clearing inline caches when
defined on a reopened refinement module.
Fixes [Bug #20246]
Fix [Bug #20246]: Don't set next_head_exact if a capture is called (#9897)
|
|
#20245] (#10307)
Fix crash when checking symbol encoding
[Bug #20245]
We sometimes pass in a fake string to sym_check_asciionly. This can crash
if sym_check_asciionly raises because it creates a CFP with the fake
string as the receiver which will crash if GC tries to mark the CFP.
For example, the following script crashes:
GC.stress = true
Object.const_defined?("\xC3")
|
|
#20207] (#10299)
Correctly handle consecutive lookarounds (#9738)
Fix [Bug #20207]
Fix [Bug #20212]
Handling consecutive lookarounds in init_cache_opcodes is buggy, so it
causes invalid memory access reported in [Bug #20207] and [Bug #20212].
This fixes it by using recursive functions to detected lookarounds
nesting correctly.
|
|
01bfd1a2bf013a9ed92a9722ac5228187e05e6a8,1c120efe02d079b0a1dea573cf0fd7978d9cc857,31378dc0969f4466b2122d730b7298dd7004acdf: [Backport #20228] (#10301)
Fix memory leak in OnigRegion when match raises
[Bug #20228]
rb_reg_onig_match can raise a Regexp::TimeoutError, which would cause
the OnigRegion to leak.
Fix memory leak in stk_base when Regexp timeout
[Bug #20228]
If rb_reg_check_timeout raises a Regexp::TimeoutError, then the stk_base
will leak.
Add memory leak test for Regexp timeout
[Bug #20228]
|
|
#20190] (#10300)
Fix coderange of invalid_encoding_string.<<(ord)
Appending valid encoding character can change coderange from invalid to valid.
Example: "\x95".force_encoding('sjis')<<0x5C will be a valid string "\x{955C}"
|
|
#20213] (#10297)
Fix incorrect use of VM_CALL_KW_SPLAT_MUT in zsuper with keyword splat
For zsuper calls with a keyword splat but no actual keywords, the
keyword splat is passed directly, so it cannot be mutable, because
if the callee accepts a keyword splat, changes to the keyword splat
by the callee would be reflected in the caller.
While here, simplify the logic when the method supports
literal keywords. I don't think it is possible for
a method with has_kw param flags to not have keywords, so add an
assertion for that, and set VM_CALL_KW_SPLAT_MUT in a single place.
|
|
#20194] (#10295)
Memory leak with TracePoint on bmethod
[Bug #20194]
When disabling the TracePoint on bmethod, the hooks list is not freed.
For example:
obj = Object.new
obj.define_singleton_method(:foo) {}
bmethod = obj.method(:foo)
tp = TracePoint.new(:return) {}
10.times do
100_000.times do
tp.enable(target: bmethod) {}
end
puts `ps -o rss= -p #{$$}`
end
Before:
18208
22832
26528
29728
34000
37776
40864
44400
47680
51504
After:
16688
17168
17168
17248
17696
17760
17824
17824
17856
17920
---
test/ruby/test_settracefunc.rb | 13 +++++++++++++
vm_trace.c | 1 +
2 files changed, 14 insertions(+)
|
|
#20098] (#10298)
Fix [Bug #20098]: set counter value for {n,m} repetition correctly (#9391)
|
|
outgoi… (#9791)
Revert "Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns"
This reverts commit 673ed41c81cf5a6951bcb2c3dec82d7bd6ea7440.
|
|
merge revision(s) 2cc7a56e,b0711b1,db5d9429: [Backport #20209]
YJIT: Avoid leaks by skipping objects with a singleton class
For receiver with a singleton class, there are multiple vectors YJIT can
end up retaining the object. There is a path in jit_guard_known_klass()
that bakes the receiver into the code, and the object could also be kept
alive indirectly through a path starting at the CME object baked into
the code.
To avoid these leaks, avoid compiling calls on objects with a singleton
class.
See: https://github.com/Shopify/ruby/issues/552
[Bug #20209]
---
yjit/bindgen/src/main.rs | 1 +
yjit/src/codegen.rs | 17 +++++++++++++++++
yjit/src/cruby_bindings.inc.rs | 1 +
yjit/src/stats.rs | 2 ++
4 files changed, 21 insertions(+)
YJIT: Fix tailcall and JIT entry eating up FINISH frames (#9729)
Suppose YJIT runs a rb_vm_opt_send_without_block()
fallback and the control frame stack looks like:
```
will_tailcall_bar [FINISH]
caller_that_used_fallback
```
will_tailcall_bar() runs in the interpreter and sets up a tailcall.
Right before JIT_EXEC() in the `send` instruction, the stack will look like:
```
bar [FINISH]
caller_that_used_fallback
```
Previously, JIT_EXEC() ran bar() in JIT code, which caused the `FINISH`
flag to return to the interpreter instead of to the JIT code running
caller_that_used_fallback(), causing code to run twice and probably
crash. Recent flaky failures on CI about "each stub expects a particular
iseq" are probably due to leaving methods twice in
`test_optimizations.rb`.
Only run JIT code from the interpreter if a new frame is pushed.
---
test/ruby/test_optimization.rb | 11 +++++++++++
vm_exec.h | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
YJIT: No need to RESTORE_REG now that we reject tailcalls
Thanks to Kokubun for noticing.
Follow-up: b0711b1cf152afad0a480ee2f9bedd142a0d24ac
---
vm_exec.h | 1 -
1 file changed, 1 deletion(-)
|
|
#20150] (#10253)
Fix memory leak in grapheme clusters
[Bug #20150]
String#grapheme_cluters and String#each_grapheme_cluster leaks memory
because if the string is not UTF-8, then the created regex will not
be freed.
For example:
str = "hello world".encode(Encoding::UTF_32LE)
10.times do
1_000.times do
str.grapheme_clusters
end
puts `ps -o rss= -p #{$$}`
end
Before:
26000
42256
59008
75792
92528
109232
125936
142672
159392
176160
After:
9264
9504
9808
10000
10128
10224
10352
10544
10704
10896
---
string.c | 98 +++++++++++++++++++++++++++++++-----------------
test/ruby/test_string.rb | 11 ++++++
2 files changed, 75 insertions(+), 34 deletions(-)
|
|
merge revision(s) 596db9c1f486d6609a4e97d82c8c71b54609fb6f: [Backport #20090]
[Feature #19370] Blocks without anonymous parameters should not
affect
---
parse.y | 4 ++--
test/ruby/test_syntax.rb | 7 +++++++
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
* Merge RubyGems-3.5.4 and Bundler-2.5.4
* Merge RubyGems-3.5.5 and Bundler-2.5.5
* Make tests play with upstream Ruby tests
CI broke in https://github.com/ruby/ruby/pull/9604 because if any Ruby
tests run `require 'net/http'`, they will pollute the
`$LOADED_FEATURES` for the RubyGems tests. We can fix this by renaming
the test default gem from `net-http` to `my-http`.
See https://github.com/rubygems/rubygems/pull/7379#issuecomment-1901241299
for more details.
---------
Co-authored-by: Stan Hu <[email protected]>
|
|
(#9829)
merge revision(s) c5cf4d4e129f64cb69aaf0a829aed068ef1943c4: [Backport #19542]
Improve behavioural consistency of unallocated (zero length)
`IO::Buffer`. (#9532)
This makes the behaviour of IO::Buffer.new(0) and IO::Buffer.new.slice(0, 0) consistent.
Fixes https://bugs.ruby-lang.org/issues/19542 and https://bugs.ruby-lang.org/issues/18805.
---
io_buffer.c | 14 ++++++--------
test/ruby/test_io_buffer.rb | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 8 deletions(-)
|
|
YJIT: Let RubyVM::YJIT.enable respect --yjit-stats
|
|
* Show OpenSSL version in the error message of assert_equal
* OpenSSL 3.2.1 30 Jan 2024 is also broken
|
|
merge revision(s) 82b57d7bfeefd717c10f7a5a3484aca6b3e708a3: [Backport #20162]
Fix memory leak when duplicating too complex object
[Bug #20162]
Creating a ST table then calling st_replace leaks memory because the
st_replace overwrites the ST table without freeing any of the existing
memory. This commit changes it to use st_copy instead.
For example:
RubyVM::Shape.exhaust_shapes
o = Object.new
o.instance_variable_set(:@a, 0)
10.times do
100_000.times { o.dup }
puts `ps -o rss= -p #{$$}`
end
Before:
23264
33600
42672
52160
61600
71728
81056
90528
100560
109840
After:
14752
14816
15584
15584
15664
15664
15664
15664
15664
15664
---
object.c | 3 +--
test/ruby/test_shapes.rb | 13 +++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
|
|
Fix to work match cache with peek next optimization (#9459)
---
regexec.c | 3 ++-
test/ruby/test_regexp.rb | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
Fix test case for `test_match_cache_with_peek_optimization` (#9466)
---
test/ruby/test_regexp.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
* Fix GC.measure_total_time regression
Commit 93ac7405b80cc61930d73da04441fa09af1851e1 introduced a regression
where measurements would still be taken after setting
GC.measure_total_time = false.
Fixes [Bug #20157]
* Add test case for GC.measure_total_time
---------
Co-authored-by: Rian McGuire <[email protected]>
|
|
Memory leak when duplicating identhash
[Bug #20145]
Before this commit, both copy_compare_by_id and hash_copy will create a
copy of the ST table, so the ST table created in copy_compare_by_id will
be leaked.
h = { 1 => 2 }.compare_by_identity
10.times do
1_000_000.times do
h.select { false }
end
puts `ps -o rss= -p #{$$}`
end
Before:
110736
204352
300272
395520
460704
476736
542000
604704
682624
770528
After:
15504
16048
16144
16256
16320
16320
16752
16752
16752
16752
---
hash.c | 10 +++++++++-
test/ruby/test_hash.rb | 10 ++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
|
|
Don't create T_MATCH object if /regexp/.match(string) doesn't match
Fixes [Bug #20104]
---
re.c | 9 ++++++---
test/ruby/test_regexp.rb | 12 ++++++++++++
tool/lib/envutil.rb | 8 ++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
|
|
[Backport #20094]"
This reverts commit d4b780e84e9a6b858d0f6c6a44b22da0d2f5835e.
|
|
[Bug #20094] Distinguish `begin` and parentheses
---
compile.c | 1 +
parse.y | 36 +++++++++++++++++++++---------------
test/ruby/test_whileuntil.rb | 18 ++++++++++++++++++
3 files changed, 40 insertions(+), 15 deletions(-)
|
|
Fix [Bug #20083]: correct a cache point size for atomic groups
(#9367)
---
regexec.c | 2 +-
test/ruby/test_regexp.rb | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
|
|
Fix Window private file mapping unlink EACCES issue. (#9358)
* Don't return early.
* Add missing `mapping` assignment.
* Make debug logs conditional.
---
io_buffer.c | 18 ++++++++++++------
test/ruby/test_io_buffer.rb | 32 ++++++++++++++------------------
2 files changed, 26 insertions(+), 24 deletions(-)
|
|
* Bump up net-ftp to 0.3.4
* Bump up net-smtp to 0.4.0.1
* Bump up net-imap to 0.4.9.1
* [ruby/net-http] Renew test certificates
The private key is replaced with a public known test key published at
[RFC 9500].
Also lifetime has been extended to 10 years from 4 years.
[RFC 9500]: https://www.rfc-editor.org/rfc/rfc9500.html
https://github.com/ruby/net-http/commit/4ab6c4a500
* Bump up net-http to 0.4.1
---------
Co-authored-by: Sorah Fukumori <[email protected]>
|
|
|
|
Run this test separately because something seems remained unreleased
on Windows.
|
|
RUBY_FL_PROMOTED is used by the garbage collector to track when an
object becomes promoted to the old generation. rb_obj_setup must not
copy that flag over because then it may become out-of-sync with the age
of the object.
This fixes a bug in Method#clone where the cloned Method object may get
RUBY_FL_PROMOTED incorrectly set.
|
|
|
|
The test fails when RGENGC_CHECK_MODE is turned on:
1) Failure:
TestSymbol#test_inspect_under_gc_compact_stress [test/ruby/test_symbol.rb:123]:
<":testing"> expected but was
<":\x00\x00\x00\x00\x00\x00\x00">.
|
|
The for loops for marking and reference updating declaratively marked
TypedData objects did not mark/reference update the very last element.
When RGENGC_CHECK_MODE is turned on, this caused the test in Enumerator
to fail with:
tool/lib/test/unit/testcase.rb:173:in `rescue in run': failed to allocate memory (NoMemoryError)
|
|
* Avoiding using `Tempfile` which was retaining the file preventing it from unlinking.
|
|
enumerator_block_call was not safe for compaction because the Array
backing the argv was not pinned, so it could get moved during compaction
which would make argv point to somewhere else.
The test crashes when RGENGC_CHECK_MODE is turned on:
TestEnumerator#test_with_index_under_gc_compact_stress
check_rvalue_consistency: 0x55db0b399450 is not a Ruby object.
test/ruby/test_enumerator.rb:133: [BUG] check_rvalue_consistency_force: there is 1 errors.
ruby 3.3.0dev (2023-12-23T23:00:27Z master 50bf437341) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0034 p:---- s:0192 e:000187 CFUNC :with_index
c:0033 p:---- s:0185 e:000184 CFUNC :each
c:0032 p:---- s:0182 e:000181 CFUNC :to_a
c:0031 p:0055 s:0178 e:000175 BLOCK test/ruby/test_enumerator.rb:133
c:0030 p:0024 s:0172 e:000171 METHOD tool/lib/envutil.rb:242
c:0029 p:0024 s:0167 e:000166 METHOD tool/lib/envutil.rb:251
c:0028 p:0005 s:0160 e:000159 METHOD test/ruby/test_enumerator.rb:131
...
-- C level backtrace information -------------------------------------------
build/ruby(rb_print_backtrace+0x14) [0x55db0b1deb21] vm_dump.c:820
build/ruby(rb_vm_bugreport) vm_dump.c:1151
build/ruby(bug_report_end+0x0) [0x55db0b3a53a6] error.c:1042
build/ruby(rb_bug_without_die) error.c:1042
build/ruby(die+0x0) [0x55db0afc77c2] error.c:1050
build/ruby(rb_bug) error.c:1052
build/ruby(gc_move+0x0) [0x55db0afbada0] gc.c:1714
build/ruby(check_rvalue_consistency+0xa) [0x55db0afef0c3] gc.c:1729
build/ruby(is_markable_object) gc.c:4769
build/ruby(gc_mark_stack_values) gc.c:6595
build/ruby(rb_gc_mark_vm_stack_values) gc.c:6605
build/ruby(rb_execution_context_mark+0x39) [0x55db0b1d8589] vm.c:3309
build/ruby(thread_mark+0x15) [0x55db0b1a9805] vm.c:3381
build/ruby(gc_mark_stacked_objects+0x6d) [0x55db0aff2c3d] gc.c:7564
build/ruby(gc_mark_stacked_objects_all) gc.c:7602
build/ruby(gc_marks_rest) gc.c:8797
build/ruby(gc_marks+0xd) [0x55db0aff43d5] gc.c:8855
build/ruby(gc_start) gc.c:9608
build/ruby(rb_multi_ractor_p+0x0) [0x55db0aff5463] gc.c:9489
build/ruby(rb_vm_lock_leave) vm_sync.h:92
build/ruby(garbage_collect) gc.c:9491
build/ruby(newobj_slowpath+0xcb) [0x55db0aff57ab] gc.c:2871
build/ruby(newobj_slowpath_wb_protected) gc.c:2895
build/ruby(newobj_of0+0x24) [0x55db0aff59e4] gc.c:2937
build/ruby(newobj_of) gc.c:2947
build/ruby(rb_wb_protected_newobj_of) gc.c:2962
build/ruby(ary_alloc_embed+0x10) [0x55db0b2f3e40] array.c:668
build/ruby(ary_new) array.c:709
build/ruby(rb_ary_tmp_new_from_values) array.c:759
build/ruby(rb_ary_new_from_values) array.c:771
build/ruby(args_copy+0x18) [0x55db0b1bbb88] vm_args.c:158
|
|
rb_reg_desc was not safe for GC compaction because it took in the C
string and length but not the backing String object so it get moved
during compaction. This commit changes rb_reg_desc to use the string
from the Regexp object.
The test fails when RGENGC_CHECK_MODE is turned on:
TestRegexp#test_inspect_under_gc_compact_stress [test/ruby/test_regexp.rb:474]:
<"(?-mix:\\/)|"> expected but was
<"/\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00/">.
|
|
The test fails when RGENGC_CHECK_MODE is turned on:
TestRegexp#test_match_under_gc_compact_stress:
NoMethodError: undefined method `match' for nil
test_regexp.rb:878:in `block in test_match_under_gc_compact_stress'
|
|
* Restore experimental warnings.
* Documentation and code structure improvements.
* Improved validation of flags, clarified documentation of argument handling.
* Remove inconsistent use of `Example:` and add example to `null?`.
* Expose `IO::Buffer#private?` and add test.
|