Hello apologies if this ticket is early (I see it's not yet listed in the officially tested versions in the readme) - but I'm getting segfaults running sidekiq ever since upgrading to ruby 2.30. What seems to be particular about this is that a single sidekiq process will never segfault but running multiple processes on the same machine (Mac OS X 10.10) the second or third process usually will (foreman start which starts all the dynos in the procfile always segfaults).
Here is the traceback:
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275: [BUG] Segmentation fault at 0x00000200000000
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/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:0020 p:---- s:0076 e:000075 CFUNC :require
c:0019 p:0012 s:0072 e:000071 BLOCK /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275
c:0018 p:0059 s:0070 e:000069 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240
c:0017 p:0031 s:0065 e:000064 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275
c:0016 p:0075 s:0060 e:000059 TOP /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/oj-2.13.1/lib/oj.rb:40 [FINISH]
c:0015 p:---- s:0058 e:000057 CFUNC :require
c:0014 p:0042 s:0054 e:000053 BLOCK /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77 [FINISH]
c:0013 p:---- s:0050 e:000049 CFUNC :each
c:0012 p:0062 s:0047 e:000046 BLOCK /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72 [FINISH]
c:0011 p:---- s:0041 e:000040 CFUNC :each
c:0010 p:0038 s:0038 e:000037 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61
c:0009 p:0019 s:0034 e:000033 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99
c:0008 p:0054 s:0030 e:000029 TOP /Users/pik/git/tradegecko/config/application.rb:7 [FINISH]
c:0007 p:---- s:0028 e:000027 CFUNC :require
c:0006 p:0230 s:0024 e:000023 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/lib/sidekiq/cli.rb:242
c:0005 p:0008 s:0021 e:000020 METHOD /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/lib/sidekiq/cli.rb:50
c:0004 p:0054 s:0014 e:000013 TOP /Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/bin/sidekiq:13 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :load
c:0002 p:0147 s:0006 E:000760 EVAL /Users/pik/.rbenv/versions/2.3.0/bin/sidekiq:23 [FINISH]
c:0001 p:0000 s:0002 E:000080 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/Users/pik/.rbenv/versions/2.3.0/bin/sidekiq:23:in `<main>'
/Users/pik/.rbenv/versions/2.3.0/bin/sidekiq:23:in `load'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/bin/sidekiq:13:in `<top (required)>'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/lib/sidekiq/cli.rb:50:in `run'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/lib/sidekiq/cli.rb:242:in `boot_system'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/sidekiq-3.5.1/lib/sidekiq/cli.rb:242:in `require'
/Users/pik/git/tradegecko/config/application.rb:7:in `<top (required)>'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/oj-2.13.1/lib/oj.rb:40:in `<top (required)>'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275:in `require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275:in `block in require'
/Users/pik/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:275:in `require'
-- Machine register context ------------------------------------------------
rax: 0x0000000200000000 rbx: 0x00007fdff9c093a0 rcx: 0x0000000000000000
rdx: 0x0000000000000000 rdi: 0x00007fdff9c093a0 rsi: 0x0000000200000010
rbp: 0x00007fff5eafd920 rsp: 0x00007fff5eafd910 r8: 0x0000000020528805
r9: 0x00007fdff9c093a0 r10: 0x00007fdffd700000 r11: 0xffffffffffe9c35f
r12: 0x0000000000000000 r13: 0x0000008000000001 r14: 0x0000000200000010
r15: 0x00007fdff9c093a0 rip: 0x000000010116ade2 rfl: 0x0000000000010206
-- C level backtrace information -------------------------------------------
0 ruby 0x000000010129c504 rb_vm_bugreport + 388
1 ruby 0x000000010113fc03 rb_bug_context + 483
2 ruby 0x0000000101211583 sigsegv + 83
3 libsystem_platform.dylib 0x00007fff87362f1a _sigtramp + 26
4 ruby 0x000000010116ade2 gc_mark_ptr + 82
5 ??? 0x00007fdffd61b140 0x0 + 140600005472576
-- Other runtime information -----------------------------------------------
* Loaded script: /Users/pik/.rbenv/versions/2.3.0/bin/sidekiq
Full log: (https://gist.github.com/pik/514955728bda881ea2ae)
I've logged a few runs with logging in active_support to see it was a particular dependency causing it - but it always seems to be different. I haven't much experience with debugging on OS X (although it's what everyone uses at work) - I think dtruss can emulate strace but I will need to read up on that.
P.S. I've tried upgrading to 4.0.2 (disabling sidekiq-pro and a few other extensions which are only < 4.0) compatible and that seems to work (I've also experienced the same seg-fault after disabling sidekiq-pro and third-party extensions with 3.51).
Same here on Ubuntu 14.04
[BUG] Segmentation fault at 0x00000000000000
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0025 p:---- s:0094 e:000093 CFUNC :require
c:0024 p:0012 s:0090 e:000089 BLOCK /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:27
c:0023 p:0059 s:0088 e:000087 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:24
c:0022 p:0017 s:0083 e:000082 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:27
c:0021 p:0071 s:0078 e:000077 TOP /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/warden-1.2.4/lib/warden.rb:10 [FINISH]
c:0020 p:---- s:0076 e:000075 CFUNC :require
c:0019 p:0012 s:0072 e:000071 BLOCK /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:27
c:0018 p:0059 s:0070 e:000069 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:24
c:0017 p:0017 s:0065 e:000064 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:27
c:0016 p:0081 s:0060 e:000059 TOP /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/devise-3.5.1/lib/devise.rb:487 [FINISH]
c:0015 p:---- s:0058 e:000057 CFUNC :require
c:0014 p:0042 s:0054 e:000053 BLOCK /home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77 [FINISH]
c:0013 p:---- s:0050 e:000049 CFUNC :each
c:0012 p:0062 s:0047 e:000046 BLOCK /home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72 [FINISH]
c:0011 p:---- s:0041 e:000040 CFUNC :each
c:0010 p:0038 s:0038 e:000037 METHOD /home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61
c:0009 p:0019 s:0034 e:000033 METHOD /home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99
c:0008 p:0054 s:0030 e:000029 TOP /home/myuser/apps/myapp_production/releases/20160111122441/config/application.rb:7 [FINISH]
c:0007 p:---- s:0028 e:000027 CFUNC :require
c:0006 p:0230 s:0024 e:000023 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:241
c:0005 p:0008 s:0021 e:000020 METHOD /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:50
c:0004 p:0054 s:0014 e:000013 TOP /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/bin/sidekiq:13 [FINISH]
c:0003 p:---- s:0010 e:000009 CFUNC :load
c:0002 p:0147 s:0006 E:001920 EVAL /home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/bin/sidekiq:23 [FINISH]
c:0001 p:0000 s:0002 E:001b80 (none) [FINISH]
-- Ruby level backtrace information ----------------------------------------
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/bin/sidekiq:23:in `<main>'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/bin/sidekiq:23:in `load'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/bin/sidekiq:13:in `<top (required)>'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:50:in `run'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:241:in `boot_system'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/sidekiq-3.5.3/lib/sidekiq/cli.rb:241:in `require'
/home/myuser/apps/myapp_production/releases/20160111122441/config/application.rb:7:in `<top (required)>'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
/home/myuser/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/devise-3.5.1/lib/devise.rb:487:in `<top (required)>'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/warden-1.2.4/lib/warden.rb:10:in `<top (required)>'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
/home/myuser/apps/myapp_production/shared/bundle/ruby/2.3.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
-- Machine register context ------------------------------------------------
RIP: 0x00007f13af64bdf2 RBP: 0x0a746f6e6e616320 RSP: 0x00007ffcc57f1200
RAX: 0x0000000000000018 RBX: 0x00007f13b03a3a00 RCX: 0x0000000000000020
RDX: 0x00000000000000e0 RDI: 0x00007f13b03a3a00 RSI: 0x0a746f6e6e616320
R8: 0x000000000000000c R9: 0x000000000085c845 R10: 0x6080200018cb1bc6
R11: 0x00007f13b03a7d10 R12: 0x0a746f6e6e614000 R13: 0x0000000000000018
R14: 0x00007f13b0f37bc0 R15: 0x00007f13b03a3a00 EFL: 0x0000000000010202
0 ruby 0x000000010129c504 rb_vm_bugreport + 388
1 ruby 0x000000010113fc03 rb_bug_context + 483
2 ruby 0x0000000101211583 sigsegv + 83
3 libsystem_platform.dylib 0x00007fff87362f1a _sigtramp + 26
4 ruby 0x000000010116ade2 gc_mark_ptr + 82
5 ??? 0x00007fdffd61b140 0x0 + 140600005472576
That looks to be a GC bug. If it doesn't happen on 2.2, you'll need to enter a Ruby 2.3 bug or wait until 2.3.1.
For anyone else who ends up here.
Bug report on Ruby https://redmine.ruby-lang.org/issues/11930
It's also linked in #2749 - I had not noticed since I generally don't look at closed issues for problems with a current version. @mperham Perhaps it would help to leave one of these issues open w/ another flag such as on hold so that it is potentially easier to locate for others?
@mperham If this ends up being a bug in Ruby instead of sidekiq, it could still be helpful to have an open issue here for folks searching. :+1: @plk
I figured out that sidekiq seems to always segfault, but RAILS_ENV=development bundle exec sidekiq does not
I think you meant to CC @pik rather than "plk" ...
Well noted @b264: RAILS_ENV=development bundle exec sidekiq indeed won't crash
@b264, thank you for the note about RAILS_ENV=development bundle exec sidekiq, works just fine. This bug is also happening to me whenever I start sidekiq, I have found that setting the environment as an argument to sidekiq will crash as well i.e: bundle exec sidekiq -e development
I am encountering this issue as well. RAILS_ENV=development bundle exec sidekiq does not resolve the issue. Encountered on ruby 2.30 and ruby 2.3.3.
Well noted @b264: RAILS_ENV=development bundle exec sidekiq not crashing! 馃憤