-
Notifications
You must be signed in to change notification settings - Fork 462
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
Segfault: net/http client #93
Comments
That's a crash with a core library in Ruby, so I would look to the Ruby mailing lists for help with that. However, I would recommend trying to reinstall Ruby and see if that helps as you are running the 2.1.0 library on 2.1.1. |
I'm also experiencing similar issues with the Twilio client |
Have you tried updating or reinstalling your Ruby interpreter? This isn't something specific to twilio-ruby but rather the ruby core. |
We tried ruby2.0 and ruby2.1 on both Mac & ubuntu 12 The problem seems to manifest under a multithreaded environment since we are using twilio-ruby in sidekiq |
I as well was having the same issue when using with sidekiq. However, I did reinstall ruby with RVM and have not experienced the issue again. |
Seeing lots of IOError, and Net:: errors due to running this gem with Sidekiq where more than one SMS send is being processed at the same time. |
@pinfieldharm We wrote our own client and this solves the problem |
@pinfieldharm We put a global mutex around all calls to the twilio gem :( |
I'm not seeing a segfault but rather an "IOError: closed stream" when processing jobs with Twilio calls and Sidekiq. I unfortunately also think I'll have to throw a global mutex around the twilio gem. It would be awesome if this library could get thread-safety sorted, but I think they may be limited by Net::HTTP. Perhaps if Twilio used something like Faraday and let us configure our own HTTP clients for use with Twilio::REST we could get it sorted. |
Is this still an issue with new versions of twilio? |
@sarmiena Yep. |
Hey guys, This is a bug with the Ruby standard Net:HTTP library related to openssl. The fix was back ported to Ruby 2.1.2, so just make sure you have an updated Ruby installation. For more info see: https://bugs.ruby-lang.org/issues/9592 and https://bugs.ruby-lang.org/issues/9839 . If you are still having issues after upgrading, let us know! |
@carlosdp thanks for pointing those out. As it so happens, I did see those and use the updated version, still had problems and commented directly on https://bugs.ruby-lang.org/issues/9839 (see the last comment). I'm no longer working with that client so I can't donate the core dump I promise in the comment, but AFAIK its still a problem. |
NOTE: We are working on the ability to specify a custom HTTP client. Hopefully that will be a solution to this rare segfault. I will close this issue when that is released. |
I needed this to work so I created a monkey patch that will make twilio works with typhoeus, until the new version of the gem is released. It patches only the POST requests. https://gist.github.com/viktornonov/487e0d56ea6ad8873f54 Also I added the typhoeus gem to the Gemfile. Solved the problem for me. |
If you upgrade to the @client.http_client.adapter = :typhoeus See the upgrade wiki for more details! |
🎉 |
Given 5.x is on the release path now and publicly available, I'm going to close this issue. Thanks for all the help guys! |
Add more next-gen PHP snippets in the REST/ directory
There seems to be an issue in the net/http standard library that is causing a segfault. I am more or less interested if their is a work around for this with the twilio gem thanks.
home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:920: [BUG] Segmentation fault at 0x007f67a4acc980
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0042 p:---- s:0198 e:000197 CFUNC :connect
c:0041 p:0008 s:0195 e:000194 BLOCK /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:920
c:0040 p:0036 s:0193 E:000b70 BLOCK /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb:91 [FINISH]
c:0039 p:---- s:0188 e:000187 CFUNC :call
c:0038 p:0069 s:0184 E:000a78 METHOD /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/timeout.rb:101
c:0037 p:0508 s:0173 E:000d28 METHOD /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:920
c:0036 p:0007 s:0162 e:000161 METHOD /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:863
c:0035 p:0036 s:0159 e:000158 METHOD /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:852
c:0034 p:0017 s:0156 e:000155 METHOD /home/ubuntu/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:1369
c:0033 p:0031 s:0149 e:000148 METHOD /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/twilio-ruby-3.11.5/lib/twilio-ruby/rest/client.rb:216
c:0032 p:0133 s:0142 e:000141 LAMBDA /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/twilio-ruby-3.11.5/lib/twilio-ruby/rest/client.rb:168 [FINISH]
c:0031 p:0031 s:0136 e:000135 METHOD /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/twilio-ruby-3.11.5/lib/twilio-ruby/rest/list_resource.rb:91
The text was updated successfully, but these errors were encountered: