Project

General

Profile

ActionsLike0

Bug #18517

closed

0 << (2**40) is NoMemoryError but 0 << (2**80) is 0

Added by Eregon (Benoit Daloze) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
[ruby-core:107290]

Description

I've been looking at Integer#{<<,>>} with RHS bignum and long and there are several issues.

This seems a clear bug though:

$ruby -e 'p 0 << (2**40)'
-e: failed to allocate memory (NoMemoryError)
$ ruby -e 'p 0 << (2**80)'
0

Related issues 1 (0 open1 closed)

Related to Ruby - Bug #18518: NoMemoryError + [FATAL] failed to allocate memory for twice 1 << largeRejectedActions
#1

Updated by Eregon (Benoit Daloze) about 3 years ago

  • Related to Bug #18518: NoMemoryError + [FATAL] failed to allocate memory for twice 1 << large added
#3

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Status changed from Open to Closed
#4

Updated by byroot (Jean Boussier) about 3 years ago

  • Backport changed from 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED

Updated by naruse (Yui NARUSE) about 3 years ago

  • Backport changed from 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED to 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE

Updated by nagachika (Tomoyuki Chikanaga) about 3 years ago

  • Backport changed from 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: REQUIRED, 3.1: DONE to 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: DONE, 3.1: DONE
#7

Updated by usa (Usaku NAKAMURA) about 3 years ago

  • Backport changed from 2.6: UNKNOWN, 2.7: REQUIRED, 3.0: DONE, 3.1: DONE to 2.6: UNKNOWN, 2.7: DONE, 3.0: DONE, 3.1: DONE
ActionsLike0

Also available in: Atom PDF