Skip to content
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

Output warning message if running version of Ruby capable of production Segmentation Fault #441

Closed
tsully193 opened this issue Jun 11, 2019 · 6 comments
Assignees
Labels
Milestone

Comments

@tsully193
Copy link

Recently we saw the Ruby agent of APM cause segmentation fault in one of our apps running version 2.5.3. A sanity check that either prevents the agent from starting or at least outputs a warning message about the possibility of segmentation fault occurring if you are running version 2.5-2.5.3 of Ruby would be greatly appreciated.

@mikker
Copy link
Contributor

mikker commented Jun 13, 2019

Hi @tsully193! This sounds like it could be this bug in Ruby itself: https://bugs.ruby-lang.org/issues/14634.

@NikolaiGulatz
Copy link

We also noticed segmentation faults in ruby ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]:

App 902879 output: /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/transport/base.rb:61: [BUG] Segmentation fault at 0x0000000000000008
App 902879 output: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
App 902879 output:
App 902879 output: -- Control frame information -----------------------------------------------
App 902879 output: c:0080 p:---- s:0542 e:000541 CFUNC  :push
App 902879 output: c:0079 p:0038 s:0536 e:000535 METHOD /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/transport/base.rb:61
App 902879 output: c:0078 p:0009 s:0530 e:000529 METHOD /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/agent.rb:114
App 902879 output: c:0077 p:0007 s:0525 e:000524 BLOCK  /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/agent.rb:71 [FINISH]
App 902879 output: c:0076 p:0029 s:0521 e:000520 METHOD /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/instrumenter.rb:181
App 902879 output: c:0075 p:0007 s:0516 e:000515 METHOD /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/agent.rb:162
App 902879 output: c:0074 p:0064 s:0512 e:000511 METHOD /var/www/app/shared/bundle/ruby/2.5.0/gems/elastic-apm-2.9.1/lib/elastic_apm/subscriber.rb:57

the fix for the above mentioned bug seems to have been backported to 2.5 here.

@mikker
Copy link
Contributor

mikker commented Aug 13, 2019

What are your server setup(s)? Are either of you using a threaded server like Puma? Do you set it to preload_app!?

@NikolaiGulatz
Copy link

We are using passenger with passenger_spawn_method smart (https://www.phusionpassenger.com/library/indepth/ruby/spawn_methods/) - no multithreading.

When I change the spawn method to direct it seems to not cause segmentation faults. This however leads to a greatly increased startup time.

I think this behaviour should be documented somewhere even though it's a ruby bug since the result of the segmentation fault is a lot of requests failing with a 502 after integrating the gem.

@mikker
Copy link
Contributor

mikker commented Nov 19, 2019

I have added a Passenger based env to our test project to try and reproduce this but haven't been able to yet. Do you see any differences between that and your setup that could potentially get the two closer?

See elastic/opbeans-ruby#13

@mikker
Copy link
Contributor

mikker commented Nov 22, 2019

When either of you have the chance to test whether this bug was also fixed for you, please report back here 😊
Feel free to reopen if this problem persists.

@mikker mikker closed this as completed Nov 22, 2019
@zube zube bot reopened this Nov 22, 2019
@zube zube bot closed this as completed Nov 22, 2019
@estolfo estolfo reopened this Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants