New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault at
after upgrading to Rails 6.0.0
#37004
Comments
Thanks for the report, that's kind of surprising. We've been running Rails 6 at GitHub for awhile now and haven't seen anything like this. This sounds like it'd be hard to reproduce and if it was simply Rails + Rspec I'd think we'd have other reports by now. Can you try reproducing in a test app? Or remove gems from your Gemfile until it goes away? Did you check Rspec issue tracker if anyone else reported something similar? Unfortunately there's not a whole lot we can investigate with this trace and no knowledge of your app's specifics 😞 |
Also are you seeing this in production or just when running tests? Are you using the Rails parallelization (the process parallelizer doesn't work with Rspec btw)? |
I'm going to close this for now since I haven't heard back. If you can reproduce this in a test app let me know and I'll reopen. |
I hit this same thing. This is when running tests. I don't know if "rails" is at all the right project for it, since it's evidently a problem with Ruby itself, but this is the only hit with Google for that version of Rails and the 'double-linked list' message.
|
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. |
Probably worth it for most people to have a look at Ruby 2.6.4 - that's going to be my first step. If I still see it, I'll see what I can put together to reproduce it. It does not happen every single run, but is somewhat random. |
Well...shoot :-(
|
I've started narrowing things down to something funny with mongoid and database_cleaner. @equivalent does that ring a bell at all? Almost positive it has little or nothing to do with Rails itself; I'll try and leave a final note for anyone searching via Google if I figure it out. |
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. |
Ok, I have a somewhat self-contained Rails app that causes the crash. But it's definitely something to do with mongo/mongoid and
Trying to narrow things down further. @amatsuda I have removed that gem too, among many others, and it still crashes. |
I am 99% sure the bug is this: |
@davidw I have the same problem on Ruby 2.6.3 and 2.6.4 |
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! |
Would you mind posting those new issues no here so that we can follow along please? 🙏 |
@stefanjohncollier as far as I can tell, the issue is the Ruby Concurrency one I linked to: ruby-concurrency/concurrent-ruby#808 Although of course I think there must be a bug in the Ruby interpreter as well if it's seg faulting. |
Ah thanks @davidw, I'll give that a subscribe! |
@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 🤔 |
@eileencodes idk if i should open an issue or not, I've also got the crash report just in case you think it's ok to open an issue.
( it's coming from the |
Please provide a test app with only Rails gems that reproduces the issue. Without that the Rails team cannot debug the problem. |
For anyone else running into this, I have filed a bug against Ruby itself, as segfaults should not happen no matter what the Ruby code is doing wrong: https://bugs.ruby-lang.org/issues/16288 It includes (in my latest comment) code that reliably segfaults Ruby without Rails, Mongo, concurrent-ruby or any of that. |
solution here ruby-concurrency/concurrent-ruby#808 (comment) |
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
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:
The text was updated successfully, but these errors were encountered: