Project

General

Profile

This project is closed and read-only.

Actions

Backport #6093

closed

Requiring mathn causes Float.to_d to SEG FAULT when used with BigDecimal

Backport #6093: Requiring mathn causes Float.to_d to SEG FAULT when used with BigDecimal

Added by mrbauer1 (Matt Bauer) over 14 years ago. Updated over 14 years ago.

Status:
Closed
Assignee:
-
[ruby-core:42969]

Description

To Reproduce:

require 'bigdecimal'
require 'bigdecimal/util'
require 'mathn'

10.0.to_d #=> Generates SEG FAULT (https://gist.github.com/1921116, https://gist.github.com/1921407)

Note only this combination of requires causes the SEG FAULT. If math isn't included, it will work as expected. I confirmed this works in 1.8.7-p249 and 1.9.2-p290 on the same platform.


Files

ruby_2012-02-26-214921_Shark.crash (13 KB) ruby_2012-02-26-214921_Shark.crash Crash Report mrbauer1 (Matt Bauer), 02/27/2012 01:32 PM
dump.txt (7.99 KB) dump.txt Segmentation Fault mrbauer1 (Matt Bauer), 02/27/2012 01:32 PM

Updated by nobu (Nobuyoshi Nakada) over 14 years ago Actions #1

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 13
  • Category deleted (core)
  • Target version deleted (1.9.3)

Updated by nobu (Nobuyoshi Nakada) over 14 years ago Actions #2

  • Tracker changed from Backport to Bug
  • Project changed from 13 to Ruby

Updated by nobu (Nobuyoshi Nakada) over 14 years ago Actions #3

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

This issue was solved with changeset r34829.
Matt, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): since methods
    can be overridden, so should not make an assumption on the type
    of results. [ruby-core:42969][Bug #6093]

Updated by nobu (Nobuyoshi Nakada) over 14 years ago Actions #4

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 13
Actions

Also available in: PDF Atom