Bug #10045

SegFault in BigDecimal in 2.1.2p95

Added by dkennedy (David Kennedy) almost 4 years ago. Updated 6 months ago.

Target version:
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]


We use Travis CI to build our code and are having issues with some builds terminating; today we caught a segfault in one of the unresponsive builds' logs. It appears to be a segfault in BigDecimal. This is in Ruby 2.1.2p95 which is currently the latest version, and we cannot see a similar bug listed already.

Unfortunately it is not easy to reproduce this bug on demand; it may be platform specific? Stack trace attached along with a little of the header matter from Travis to list Ruby versions etc.

setup build cache
attempting to download cache archive
found cache
$ rvm use 2.1.2 --install --binary --fuzzy
ruby-2.1.2 is not installed - installing.
Searching for binary rubies, this might take some time.
Found remote file
Checking requirements for ubuntu.
Requirements installation successful.
ruby-2.1.2 - #configure
ruby-2.1.2 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.2M  100 21.2M    0     0  25.6M      0 --:--:-- --:--:-- --:--:-- 26.0M
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.2 - #validate archive
ruby-2.1.2 - #extract
ruby-2.1.2 - #validate binary
ruby-2.1.2 - #setup
ruby-2.1.2 - #making binaries executable..
Rubygems 2.2.2 already available in installed ruby, skipping installation, use --force to reinstall.
ruby-2.1.2 - #gemset created /home/travis/.rvm/gems/ruby-2.1.2@global
ruby-2.1.2 - #importing gemset /home/travis/.rvm/gemsets/global.gems................................
ruby-2.1.2 - #generating global wrappers.........
ruby-2.1.2 - #uninstalling gem rubygems-bundler-1.4.4.
ruby-2.1.2 - #gemset created /home/travis/.rvm/gems/ruby-2.1.2
ruby-2.1.2 - #importing gemset /home/travis/.rvm/gemsets/default.gems................
ruby-2.1.2 - #generating default wrappers.........
Using /home/travis/.rvm/gems/ruby-2.1.2
$ export BUNDLE_GEMFILE=$PWD/Gemfile
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
$ rvm --version
rvm 1.25.25 (latest-minor) by Wayne E. Seguin <>, Michal Papis <> []
$ gem --version
$ bundle --version
Bundler version 1.6.2
adding /home/travis/build/shopkeep/backoffice/vendor/bundle to cache

bug-10045.log (542 KB) bug-10045.log nobu (Nobuyoshi Nakada), 07/16/2014 04:33 PM


#1 [ruby-core:63770] Updated by dkennedy (David Kennedy) almost 4 years ago

Actually, I'm not sure if this should be core or extensions? Please correct as needed during triage; I'm not familiar with the core project's processes.

#2 [ruby-core:63773] Updated by phasis68 (Heesob Park) almost 4 years ago

It seems that this bug is a duplicate of bug #9657.
The bug was fixed and backported to ruby-2.1.2

The above stack trace shows that rubygems(bigdecimal-1.2.5) version of BigDecimal module is used instead of embedded extension library version.

Try after removing bigdecimal-1.2.5 gem.

#4 [ruby-core:63776] Updated by mrkn (Kenta Murata) almost 4 years ago

  • Assignee set to mrkn (Kenta Murata)

#5 [ruby-core:63980] Updated by dkennedy (David Kennedy) almost 4 years ago

I've been unable to replicate the segfault on demand.

Because I've been unable to create the segfault on demand I am unwilling to remove the BigDecimal-1.2.5 gem - we started using it specifically to avoid another segfault a few months ago (possibly but I am not sure)

Looking at 2.1.2 head the integrated version of BigDecimal is at 2.1.4, so removing the BigDecimal external gem would leave us exposed to the previous segfault bug.

#6 Updated by zzak (Zachary Scott) almost 4 years ago

  • Status changed from Open to Assigned

#7 [ruby-core:64235] Updated by zzak (Zachary Scott) almost 4 years ago

Does using the gem fix the segfaults for you?

#8 [ruby-core:65653] Updated by hsbt (Hiroshi SHIBATA) over 3 years ago

  • Status changed from Assigned to Feedback
  • Priority changed from 5 to Normal

Could you try with latest version of Ruby 2.1?

#9 Updated by naruse (Yui NARUSE) 6 months ago

  • Target version deleted (2.6)

Also available in: Atom PDF