rails: `Segmentation fault at` after upgrading to Rails 6.0.0

Steps to reproduce

I’ve upgraded application from Rails 5.2 to 6.0.0 now every time I run RSpec at the end of it I get message below

Finished in 49.25 seconds (files took 9.17 seconds to load)
25 examples, 0 failures

[BUG] Segmentation fault at 0x0000000000000050
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]


-- Machine register context ------------------------------------------------
RIP: 0x00007f531acb47c3 RBP: 0x00007f5307576e50 RSP: 0x00007f5307576c90
RAX: 0x0000000000000000 RBX: 0x00007f531acb4a70 RCX: 0x000055d53b7b2030
RDX: 0x000055d53b7b1c18 RDI: 0x000055d5463a4848 RSI: 0x000055d5463a45f0
R8: 0x0000000000000000  R9: 0x000055d547ff6ac9 R10: 0x000055d547ff6ab0
R11: 0x00007f531b0106b0 R12: 0x000055d5463a45f0 R13: 0x00007f5307577700
R14: 0x00007f531b002a90 R15: 0x00007f5307576ea8 EFL: 0x0000000000010297

-- C level backtrace information -------------------------------------------
corrupted double-linked list
Aborted (core dumped)

funny thing is the test pass (green) but I get error message at the end

the error happens pretty much on any type of tests, nothing specific to test itself. All that was needed is Rails 6 app and RSpec

I don’t know if this is Rspec error or Rails error or Ruby error 🤔

System configuration

Rails version: 6.0.0

Ruby version: 2.6.3p62

happnes:

  • in my laptop (Ubuntu 18)
  • in codeship VM

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (18 by maintainers)

Most upvoted comments

@davidw my apology I forgot to reply to your comment yes I’m using mongoid and Database cleaner too same way as you are 🤔

I’ll try play around with disabling some parts of mongo tests in my app to see what happens and let you know. But if it’s really Ruby side (link) then that will be fun one to find 😢

@eileencodes sorry I didn’t reply to your initial comment but I wasn’t able to pinpoint anything how to reproduce this at the time.

Thank you @davidw for doing the hard work digging deeper around this issue 🙏


update later that day: nope tried to disable bunch of mongoid / database cleaner related tests or configurations , upgraded mongoid ref didn’t work 🤔

OK sounds like this isn’t a Rails issue, can you take this up with the appropriate projects and followup when it’s fixed? Thanks!

If I’m seeing segfaults on my Rails app, I would try this first.

diff --git a/Gemfile b/Gemfile
index 28a671a..2c3e3eb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -25,9 +25,6 @@ gem 'jbuilder', '~> 2.7'
 # Use Active Storage variant
 # gem 'image_processing', '~> 1.2'
 
-# Reduces boot times through caching; required in config/boot.rb
-gem 'bootsnap', '>= 1.4.2', require: false
-
 group :development, :test do
   # Call 'byebug' anywhere in the code to stop execution and get a debugger console
   gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
diff --git a/config/boot.rb b/config/boot.rb
index b9e460c..30f5120 100644
--- a/config/boot.rb
+++ b/config/boot.rb
@@ -1,4 +1,3 @@
 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
 
 require 'bundler/setup' # Set up gems listed in the Gemfile.
-require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

As I said to @equivalent we can’t debug this without a way to reproduce it. Please provide a sample application that reproduces the segfault.