Skip to content

Segmentation fault on Ruby 2.5.1 when exiting rails console or after rake tasks #104

@jeromedalbert

Description

@jeromedalbert

Steps to reproduce

  1. Use Ruby 2.5.1 on a Rails project (the Rails version I tested on was 5.1.6)
  2. Make sure spring is stopped with spring stop
  3. Run rails console
  4. Exit the console
  5. The following error appears:
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:171: [BUG] Segmentation fault at 0x000070000b0821e0
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.
Don't forget to include the above Crash Report log file in bug reports.

-- Control frame information -----------------------------------------------
c:0010 p:---- s:0056 e:000055 CFUNC  :fork
c:0009 p:0240 s:0052 E:001b40 METHOD /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:171
c:0008 p:0065 s:0038 E:001bb0 BLOCK  /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141 [FINISH]
c:0007 p:---- s:0035 e:000034 CFUNC  :loop
c:0006 p:0020 s:0031 E:001b90 METHOD /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135
c:0005 p:0153 s:0027 E:000878 TOP    /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19 [FINISH]
c:0004 p:---- s:0023 e:000022 CFUNC  :require
c:0003 p:0110 s:0018 E:001ca0 METHOD /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59
c:0002 p:0006 s:0006 E:001cf0 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0003 E:000580 (none) [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `serve'
/usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/application.rb:171:in `fork'

-- Machine register context ------------------------------------------------
 rax: 0x00007fb420c0c0b0 rbx: 0x000000010fa75000 rcx: 0x0000000000000006
 rdx: 0x0000000000000004 rdi: 0x00007fb42eb407c8 rsi: 0x00007fb4291bb4e0
 rbp: 0x00007ffee3514be0 rsp: 0x00007ffee3514bb0  r8: 0x000000000000401a
  r9: 0xcccccccccccccccd r10: 0x000000000000084f r11: 0x3ffffffffffffff8
 r12: 0x000070000b0821e0 r13: 0x3ffffffffffffff8 r14: 0x00007fb420c0c6b0
 r15: 0x000000000000059d rip: 0x000000010c77c403 rfl: 0x0000000000010202

-- C level backtrace information -------------------------------------------
0   libruby.2.5.dylib                   0x000000010c8e29b7 rb_vm_bugreport + 135
1   libruby.2.5.dylib                   0x000000010c7625b8 rb_bug_context + 472
2   libruby.2.5.dylib                   0x000000010c8535b1 sigsegv + 81
3   libsystem_platform.dylib            0x00007fff6f514f5a _sigtramp + 26
4   libruby.2.5.dylib                   0x000000010c77c403 rb_gc_mark_machine_stack + 99
5   libruby.2.5.dylib                   0x000000010c8d19b9 rb_execution_context_mark + 137
6   libruby.2.5.dylib                   0x000000010c749d2b cont_mark + 27
7   libruby.2.5.dylib                   0x000000010c787da1 gc_marks_finish + 721
8   libruby.2.5.dylib                   0x000000010c7879ce gc_marks_rest + 62
9   libruby.2.5.dylib                   0x000000010c77b3e7 rb_gc_call_finalizer_at_exit + 103
10  libruby.2.5.dylib                   0x000000010c76c27e ruby_cleanup + 606
11  libruby.2.5.dylib                   0x000000010c76c389 ruby_stop + 9
12  libruby.2.5.dylib                   0x000000010c80a1e7 rb_f_fork + 103
13  libruby.2.5.dylib                   0x000000010c8d5f21 vm_call_cfunc + 289
14  libruby.2.5.dylib                   0x000000010c8be0c7 vm_exec_core + 10119
15  libruby.2.5.dylib                   0x000000010c8d064e vm_exec + 142
16  libruby.2.5.dylib                   0x000000010c8dde0e invoke_block_from_c_bh + 382
17  libruby.2.5.dylib                   0x000000010c8deec3 loop_i + 35
18  libruby.2.5.dylib                   0x000000010c76cd17 rb_rescue2 + 311
19  libruby.2.5.dylib                   0x000000010c8d5f21 vm_call_cfunc + 289
20  libruby.2.5.dylib                   0x000000010c8be0c7 vm_exec_core + 10119
21  libruby.2.5.dylib                   0x000000010c8d064e vm_exec + 142
22  libruby.2.5.dylib                   0x000000010c7b2e41 rb_load_internal0 + 337
23  libruby.2.5.dylib                   0x000000010c7b3716 rb_require_internal + 1766
24  libruby.2.5.dylib                   0x000000010c7b2ed8 rb_f_require + 24
25  libruby.2.5.dylib                   0x000000010c8d5f21 vm_call_cfunc + 289
26  libruby.2.5.dylib                   0x000000010c8beb31 vm_exec_core + 12785
27  libruby.2.5.dylib                   0x000000010c8d064e vm_exec + 142
28  libruby.2.5.dylib                   0x000000010c76c521 ruby_exec_internal + 177
29  libruby.2.5.dylib                   0x000000010c76c418 ruby_run_node + 56
30  ruby                                0x000000010c6e8f2f main + 79

-- Other runtime information -----------------------------------------------

* Loaded script: rake

* Loaded features:
    0 enumerator.so
    1 thread.rb
    2 rational.so
    3 complex.so
    4 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/enc/encdb.bundle
    5 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/enc/trans/transdb.bundle
    6 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/rbconfig.rb
    7 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/compatibility.rb
    8 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/defaults.rb
    9 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/deprecate.rb
   10 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/errors.rb
   11 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/version.rb
   12 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/requirement.rb
   13 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/platform.rb
   14 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/basic_specification.rb
   15 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/stub_specification.rb
   16 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/util/list.rb
   17 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/x86_64-darwin17/stringio.bundle
   18 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/rfc2396_parser.rb
   19 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb
   20 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/common.rb
   21 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/generic.rb
   22 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/ftp.rb
   23 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/http.rb
   24 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/https.rb
   25 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/ldap.rb
   26 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/ldaps.rb
   27 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri/mailto.rb
   28 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/uri.rb
   29 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/2.5.0/rubygems/specification.rb
[... removed for brevity ...]
 5063 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/activerecord-5.1.6/lib/active_record/coders/yaml_column.rb
 5064 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/devise-4.4.3/lib/devise/delegator.rb
 5065 /Users/jerome/c/stackshare/stackshare/config/environment.rb
 5066 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/sprockets-3.7.2/lib/rake/sprocketstask.rb
 5067 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb
 5068 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib/rspec/core/rake_task.rb
 5069 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/react_on_rails-10.1.3/lib/react_on_rails/assets_precompile.rb
 5070 /Users/jerome/c/stackshare/stackshare/lib/data_aggregator/hackernews.rb
 5071 /Users/jerome/c/stackshare/stackshare/lib/data_aggregator/reddit.rb
 5072 /Users/jerome/c/stackshare/stackshare/lib/data_aggregator/stackoverflow.rb
 5073 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/dev_caching.rb
 5074 /usr/local/Cellar/asdf/0.4.3/installs/ruby/2.5.1/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/tasks.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

Notes

  • The same happens when spring is stopped and after running a rake task, like rake routes
  • Things work perfectly with Ruby 2.5.0. The problem happens only with Ruby 2.5.1.
  • Some coworkers have seen this problem happen with gems on newer ruby versions. Maybe fixing this error is just a matter of updating your gems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions