[#116016] [Ruby master Bug#20150] Memory leak in grapheme clusters — "peterzhu2118 (Peter Zhu) via ruby-core" <ruby-core@...>
Issue #20150 has been reported by peterzhu2118 (Peter Zhu).
7 messages
2024/01/04
[#116382] [Ruby master Feature#20205] Enable `frozen_string_literal` by default — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Issue #20205 has been reported by byroot (Jean Boussier).
77 messages
2024/01/23
[ruby-core:116050] [Ruby master Bug#20157] Regression in GC.measure_total_time
From:
"kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
Date:
2024-01-06 06:49:06 UTC
List:
ruby-core #116050
Issue #20157 has been updated by kjtsanaktsidis (KJ Tsanaktsidis).
Backport PR: https://github.com/ruby/ruby/pull/9428
----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106046
* Author: rianmcguire (Rian McGuire)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.
Reproduction script:
``` ruby
puts RUBY_DESCRIPTION
GC.measure_total_time = false
puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"
# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start
puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```
Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```
Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```
It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/