-
Notifications
You must be signed in to change notification settings - Fork 405
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 when used in parallel threads #249
Comments
A segfault is something that is way out of my control. To cause a segfault involves accessing memory that doesn't technically exist. I think that if you are seeing segfaults while using this gem it's more likely something to do with a misconfigured openssl implementation. Since the linkedin gem doesn't write any C extensions it's very difficult to cause segfaults or VM crashes. I'd try posting your issue in the ruby tracker and see what they have to say. Also if you could post more context here I might have some more pointers for fixing. |
Thanks a lot. So about this crash, here is my setup:
Here is the other error I randomly get: App 1614 stderr: /Volumes/Data/Users/Solher/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/openssl/buffering.rb:326: [BUG] Segmentation fault at 0x0007feb73c45a1 |
@solher Looks like the twilio gem had a similar issue: twilio/twilio-ruby#93
|
So the solution is to put linkedin gem calls in Mutex.new.synchronize {} ? |
The only other thing we could do is mutex around the net/http calls which seem to be the problem. When we merge the faraday changes then we can discuss maybe using other http libraries like typhoeus (or make it configurable) that might not have thread safety issues. |
Ok thanks a lot ! |
It works perfectly ! No more seg fault. |
Hi,
When I try to use the Parallel gem to multi-thread my IO with the Linkedin API, I get a segmentation fault. Sometimes on "net/http.rb:920" and sometimes with "openssl/buffering.rb:326". I put the problem on the Linkedin gem because I don't get the error when I do the same with the Google API.
Do you have any idea where the problem could come from ?
Thanks
2014-11-20T10:21:27.010930+00:00 app[web.1]: App 104 stderr: /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:920: [BUG] Segmentation fault at 0x00000000000000
2014-11-20T10:21:27.010936+00:00 app[web.1]: App 104 stderr: ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]
2014-11-20T10:21:27.010938+00:00 app[web.1]: App 104 stderr:
2014-11-20T10:21:27.010945+00:00 app[web.1]: App 104 stderr: -- Control frame information -----------------------------------------------
2014-11-20T10:21:27.010947+00:00 app[web.1]: App 104 stderr: c:0027 p:---- s:0156 e:000155 CFUNC :connect
2014-11-20T10:21:27.010948+00:00 app[web.1]: App 104 stderr: c:0026 p:0008 s:0153 e:000152 BLOCK
2014-11-20T10:21:27.010950+00:00 app[web.1]: App 104 stderr: /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:920
2014-11-20T10:21:27.010952+00:00 app[web.1]: App 104 stderr: c:0025 p:0036 s:0151 E:001c30 BLOCK
2014-11-20T10:21:27.010984+00:00 app[web.1]: App 104 stderr: /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/timeout.rb:91 [FINISH]
2014-11-20T10:21:27.010986+00:00 app[web.1]: App 104 stderr: c:0024 p:----
2014-11-20T10:21:27.010990+00:00 app[web.1]: App 104 stderr: s:0146 e:000145 CFUNC :call
2014-11-20T10:21:27.010992+00:00 app[web.1]: App 104 stderr: c:0023
2014-11-20T10:21:27.010996+00:00 app[web.1]: App 104 stderr: p:0069 s:0142 E:001178 METHOD /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/timeout.rb:101
2014-11-20T10:21:27.010997+00:00 app[web.1]: App 104 stderr:
2014-11-20T10:21:27.011001+00:00 app[web.1]: App 104 stderr: c:0022 p:0508
2014-11-20T10:21:27.011004+00:00 app[web.1]: App 104 stderr: s:0131 E:001508 METHOD /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:920
2014-11-20T10:21:27.011008+00:00 app[web.1]: App 104 stderr: c:0021
2014-11-20T10:21:27.011011+00:00 app[web.1]: App 104 stderr: p:0007 s:0120 e:000119 METHOD /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:863
2014-11-20T10:21:27.011015+00:00 app[web.1]: App 104 stderr:
2014-11-20T10:21:27.011016+00:00 app[web.1]: App 104 stderr: c:0020 p:0036
2014-11-20T10:21:27.011019+00:00 app[web.1]: App 104 stderr: s:0117 e:000116 METHOD /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:852
2014-11-20T10:21:27.011023+00:00 app[web.1]: App 104 stderr: c:0019
2014-11-20T10:21:27.011026+00:00 app[web.1]: App 104 stderr: p:0017 s:0114 e:000113 METHOD /app/vendor/ruby-2.1.3/lib/ruby/2.1.0/net/http.rb:1369
2014-11-20T10:21:27.011029+00:00 app[web.1]: App 104 stderr:
2014-11-20T10:21:27.011032+00:00 app[web.1]: App 104 stderr: c:0018 p:0124
2014-11-20T10:21:27.011036+00:00 app[web.1]: App 104 stderr: s:0107 e:000106 METHOD /app/vendor/bundle/ruby/2.1.0/gems/oauth-0.4.7/lib/oauth/consumer.rb:161
2014-11-20T10:21:27.011039+00:00 app[web.1]: App 104 stderr: c:0017
2014-11-20T10:21:27.011043+00:00 app[web.1]: App 104 stderr: p:0018 s:0093 e:000092 METHOD /app/vendor/bundle/ruby/2.1.0/gems/oauth-0.4.7/lib/oauth/tokens/consumer_token.rb:25
The text was updated successfully, but these errors were encountered: