Bug #19284
closedInteger overflow when using RUBY_GC_HEAP_INIT_SLOTS environment variable
Description
If you set the environment variable RUBY_GC_HEAP_INIT_SLOTS
to anything other than 0
, an integer overflow runtime error occurs:
RUBY_GC_HEAP_INIT_SLOTS=10000 ruby -e 'puts "hello, world!"'
# => ruby: integer overflow: 3689348814741910508 * 8 > 18446744073709551615 (RuntimeError)
At this time, I'm not sure if this is platform-specific, but it's failing on Darwin as well as Heroku's environment (Linux).
Updated by peterzhu2118 (Peter Zhu) almost 2 years ago
- Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED
Thank you for reporting this bug. I have a fix here: https://github.com/ruby/ruby/pull/7044
Updated by peterzhu2118 (Peter Zhu) almost 2 years ago
- Status changed from Open to Closed
Applied in changeset git|90a80eb076429978e720e11fb17a3cbb96de3454.
Fix integer underflow when using HEAP_INIT_SLOTS
There is an integer underflow when the environment variable
RUBY_GC_HEAP_INIT_SLOTS is less than the number of slots currently
in the Ruby heap.
[Bug #19284]
Updated by naruse (Yui NARUSE) almost 2 years ago
- Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE
ruby_3_2 49cf0896a2934547c0764aadaec021fb37a2e96f merged revision(s) 90a80eb076429978e720e11fb17a3cbb96de3454.
Updated by peterzhu2118 (Peter Zhu) almost 2 years ago
- Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONE to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED, 3.2: DONE
Updated by peterzhu2118 (Peter Zhu) almost 2 years ago
- Related to Bug #19358: Segfault when setting RUBY_GC_HEAP_INIT_SLOTS to a low value added
Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
- Related to deleted (Bug #19358: Segfault when setting RUBY_GC_HEAP_INIT_SLOTS to a low value)
Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
- Has duplicate Bug #19358: Segfault when setting RUBY_GC_HEAP_INIT_SLOTS to a low value added
Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago
- Backport changed from 2.7: DONTNEED, 3.0: DONTNEED, 3.1: REQUIRED, 3.2: DONE to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONE, 3.2: DONE
ruby_3_1 782a9c2ddfcc84c3bd3a1fa153f7ac1f3e92a2e1 merged revision(s) 90a80eb076429978e720e11fb17a3cbb96de3454.
Updated by nagachika (Tomoyuki Chikanaga) almost 2 years ago
I have backported 0bb07e5ba40cdc45d55743dd1ebaadd7e7363e7f to fix test failures in RubyCI.