Issue #10749 has been updated by Kashyap K.


I've been trying out the `GC::Profiler` and noticed an oddity in the report generated on Ruby 2.2.0
via `GC::Profiler.report`. The report generated outputs a really large value under `Use Size` header
on 2.2.0 but this is not present in 2.1.0. This particular large value remains the same (as far I've 
tested it in multiple runs) across different runs.

I've posted the sample code and the report results for both Ruby 2.1.0 and Ruby 2.2.0
at this link: https://github.com/kgrz/gc_profiles

Notice the `Use Size` column's output in Ruby 2.2.0 in two runs:

Run 1: https://github.com/kgrz/gc_profiles/blob/master/2.2.0-read.txt
Run 2: https://github.com/kgrz/gc_profiles/blob/master/2.2.0-read-run-two.txt

----------------------------------------
Bug #10749: Possible overflow in GC::Profiler report on 2.2.0
https://bugs.ruby-lang.org/issues/10749#change-51061

* Author: Kashyap K
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I've been trying out the GC::Profiler module on both Ruby 2.1.0 and Ruby 2.2.0 based on the 
sample code present at https://rubybench.org and noticed a oddity in the output of GC::Profiler.report
on Ruby 2.2.0. The code snippet I was experimenting with was the IO/File read present 
at https://rubybench.org/ruby/ruby/releases?result_type=io_file_read

The output of GC::Profiler.report has a possible overflow bug which causes it to output a really
large value at some locations for that sample code and this issue is reproducible if the same
code is run. I've posted the sample code and the report results for both Ruby 2.1.0 and Ruby 2.2.0
at this link: https://github.com/kgrz/gc_profiles


Notice the "Use Size" value's output in Ruby 2.2.0 for two runs:

Run 1: https://github.com/kgrz/gc_profiles/blob/master/2.2.0-read.txt
Run 2: https://github.com/kgrz/gc_profiles/blob/master/2.2.0-read-run-two.txt



-- 
https://bugs.ruby-lang.org/