Project

General

Profile

Actions

Bug #9246

closed

NoMemoryError is occurred by simple addition of BigDecimal

Added by mrkn (Kenta Murata) over 10 years ago. Updated about 3 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-12-13 trunk 44155) [x86_64-darwin12.0]
Backport:
[ruby-core:59077]
Tags:

Description

I think the following case should raise Overflow exception.

$ ruby -rbigdecimal -ve 'p BigDecimal("1E1024819115206086200") + BigDecimal(2)'
ruby 2.1.0dev (2013-12-13 trunk 44155) [x86_64-darwin12.0]
ruby(35690,0x7fff7a1fc180) malloc: *** mmap(size=506083513682018304) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
ruby(35690,0x7fff7a1fc180) malloc: *** mmap(size=506083513682018304) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
-e:1:in +': failed to allocate memory (NoMemoryError) from -e:1:in '

Actions #1

Updated by naruse (Yui NARUSE) about 6 years ago

  • Target version deleted (2.6)

Updated by mrkn (Kenta Murata) about 3 years ago

  • Status changed from Assigned to Closed
  • Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)

This no longer occurs with the latest version of bigdecimal.

Actions

Also available in: Atom PDF

Like0
Like0Like0