Bug #5611
closedSegfault in net/http.rb
Description
=begin
Running a rails app with ruby 1.9.3, rails 3.1.1, with omniauth 1.0.0 and omniauth-facebook 1.0.0, I get this message trying to access (({/auth/facebook}))
[2011-11-10 23:01:08] INFO WEBrick 1.3.1
[2011-11-10 23:01:08] INFO ruby 1.9.3 (2011-10-30) [x86_64-darwin10.8.0]
[2011-11-10 23:01:08] INFO WEBrick::HTTPServer#start: pid=42693 port=3000
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
-- Control frame information -----------------------------------------------
c:0058 p:---- s:0348 b:0348 l:000347 d:000347 CFUNC :connect
c:0057 p:0011 s:0345 b:0345 l:001da0 d:000344 BLOCK /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799
c:0056 p:0031 s:0343 b:0343 l:000342 d:000342 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54
c:0055 p:0026 s:0331 b:0331 l:000330 d:000330 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99
c:0054 p:0485 s:0325 b:0325 l:001da0 d:001da0 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799
c:0053 p:0011 s:0317 b:0317 l:000316 d:000316 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755
c:0052 p:0048 s:0314 b:0314 l:000313 d:000313 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:744
c:0051 p:0025 s:0311 b:0311 l:000310 d:000310 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1284
c:0050 p:0642 s:0304 b:0304 l:000303 d:000303 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/adapter/net_http.rb:62
c:0049 p:0027 s:0293 b:0293 l:000292 d:000292 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/request/url_encoded.rb:14
c:0048 p:0096 s:0289 b:0289 l:000288 d:000288 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/connection.rb:207
c:0047 p:0068 s:0280 b:0280 l:000279 d:000279 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/client.rb:88
c:0046 p:0127 s:0272 b:0272 l:000271 d:000271 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/client.rb:128
c:0045 p:0060 s:0265 b:0265 l:000264 d:000264 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/strategy/auth_code.rb:29
c:0044 p:0088 s:0259 b:0259 l:000258 d:000258 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-oauth2-1.0.0/lib/omniauth/strategies/oauth2.rb:77
c:0043 p:0010 s:0255 b:0255 l:000254 d:000254 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-facebook-0959ab1962f7/lib/omniauth/strategies/facebook.rb:57
c:0042 p:0147 s:0252 b:0251 l:000250 d:000250 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-oauth2-1.0.0/lib/omniauth/strategies/oauth2.rb:61
c:0041 p:0117 s:0247 b:0247 l:000246 d:000246 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:200
c:0040 p:0232 s:0244 b:0244 l:000243 d:000243 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:166
c:0039 p:0019 s:0240 b:0240 l:000239 d:000239 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:148
c:0038 p:0044 s:0236 b:0236 l:000235 d:000235 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/builder.rb:30
c:0037 p:0014 s:0232 b:0232 l:000223 d:000231 BLOCK /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.0.6/lib/warden/manager.rb:35
c:0036 p:---- s:0230 b:0230 l:000229 d:000229 FINISH
c:0035 p:---- s:0228 b:0228 l:000227 d:000227 CFUNC :catch
c:0034 p:0086 s:0224 b:0224 l:000223 d:000223 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.0.6/lib/warden/manager.rb:34
c:0033 p:0015 s:0219 b:0219 l:000218 d:000218 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/best_standards_support.rb:17
c:0032 p:0015 s:0212 b:0212 l:000211 d:000211 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/etag.rb:23
c:0031 p:0068 s:0204 b:0204 l:000203 d:000203 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/conditionalget.rb:25
c:0030 p:0093 s:0197 b:0197 l:000196 d:000196 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/head.rb:14
c:0029 p:0046 s:0190 b:0190 l:000189 d:000189 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/params_parser.rb:21
c:0028 p:0054 s:0185 b:0185 l:000184 d:000184 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/flash.rb:243
c:0027 p:0031 s:0177 b:0177 l:000176 d:000176 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:195
c:0026 p:0013 s:0169 b:0169 l:000168 d:000168 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:190
c:0025 p:0020 s:0165 b:0165 l:000164 d:000164 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/cookies.rb:331
c:0024 p:0064 s:0157 b:0157 l:000156 d:000156 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/query_cache.rb:62
c:0023 p:0029 s:0148 b:0148 l:000147 d:000147 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:4
c:0022 p:0014 s:0140 b:0140 l:0000f0 d:000139 BLOCK /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:29
c:0021 p:0155 s:0138 b:0138 l:000137 d:000137 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:392
c:0020 p:0024 s:0128 b:0128 l:000127 d:000127 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81
c:0019 p:0013 s:0122 b:0122 l:0000f0 d:0000f0 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:28
c:0018 p:0027 s:0118 b:0118 l:000117 d:000117 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/reloader.rb:68
c:0017 p:0015 s:0113 b:0113 l:000112 d:000112 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/sendfile.rb:101
c:0016 p:0049 s:0103 b:0103 l:000102 d:000102 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/remote_ip.rb:48
c:0015 p:0017 s:0099 b:0099 l:000098 d:000098 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/show_exceptions.rb:47
c:0014 p:0027 s:0091 b:0091 l:000090 d:000090 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/logger.rb:13
c:0013 p:0155 s:0087 b:0087 l:000086 d:000086 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/methodoverride.rb:24
c:0012 p:0032 s:0081 b:0081 l:000080 d:000080 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/runtime.rb:17
c:0011 p:0068 s:0072 b:0072 l:000071 d:000071 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/lock.rb:15
c:0010 p:0124 s:0066 b:0066 l:000065 d:000065 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/static.rb:53
c:0009 p:0032 s:0060 b:0060 l:000059 d:000059 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/engine.rb:456
c:0008 p:0015 s:0056 b:0056 l:000055 d:000055 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/content_length.rb:16
c:0007 p:0015 s:0047 b:0047 l:000046 d:000046 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:14
c:0006 p:0356 s:0042 b:0042 l:000041 d:000041 METHOD /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/handler/webrick.rb:59
c:0005 p:0257 s:0030 b:0030 l:000029 d:000029 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138
c:0004 p:0393 s:0020 b:0020 l:000019 d:000019 METHOD /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94
c:0003 p:0126 s:0009 b:0009 l:0026c8 d:000008 BLOCK /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:---- s:0002 b:0002 l:000001 d:000001 TOP
-- Ruby level backtrace information ----------------------------------------
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in block in start_thread' /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in
run'
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in service' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/handler/webrick.rb:59:in
service'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:14:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/content_length.rb:16:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/engine.rb:456:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/static.rb:53:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/lock.rb:15:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/runtime.rb:17:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/methodoverride.rb:24:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.1/lib/rails/rack/logger.rb:13:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/show_exceptions.rb:47:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/remote_ip.rb:48:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/sendfile.rb:101:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/reloader.rb:68:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:28:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in
run_callbacks'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:392:in _run_call_callbacks' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:29:in
block in call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.1/lib/active_record/query_cache.rb:62:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/cookies.rb:331:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:190:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:195:in context' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/flash.rb:243:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/params_parser.rb:21:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/head.rb:14:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/conditionalget.rb:25:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.5/lib/rack/etag.rb:23:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.1/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.0.6/lib/warden/manager.rb:34:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.0.6/lib/warden/manager.rb:34:in catch' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.0.6/lib/warden/manager.rb:35:in
block in call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/builder.rb:30:in call' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:148:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:166:in call!' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-1.0.0/lib/omniauth/strategy.rb:200:in
callback_call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-oauth2-1.0.0/lib/omniauth/strategies/oauth2.rb:61:in callback_phase' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/bundler/gems/omniauth-facebook-0959ab1962f7/lib/omniauth/strategies/facebook.rb:57:in
build_access_token'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/omniauth-oauth2-1.0.0/lib/omniauth/strategies/oauth2.rb:77:in build_access_token' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/strategy/auth_code.rb:29:in
get_token'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/client.rb:128:in get_token' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/oauth2-0.5.1/lib/oauth2/client.rb:88:in
request'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/connection.rb:207:in run_request' /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/request/url_encoded.rb:14:in
call'
/Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/faraday-0.7.5/lib/faraday/adapter/net_http.rb:62:in call' /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1284:in
request'
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:744:in start' /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in
do_start'
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in connect' /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in
timeout'
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54:in timeout' /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in
block in connect'
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
I also attached the complete log file when crashed and the crashreport file.
=end
Files
Updated by bshelton (Bryan Shelton) almost 13 years ago
I have a similar problem samuelkadolph helped in the ruby-lang IRC channel. Turned out my installation was broken because it was compiling against openssl in mac port's /opt/local/lib /opt/local/include.
You could verify this by running:
otool -L /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.2.0/openssl.bundle
If it shows anything linked to /opt/local, you have the same problem I had. The only thing I could figure to do was to temporarily port uninstall -f openssl, compile ruby, and then re-install it.
I'd love some help with how to tell ruby 1.9.3's ./configure explicitly where the openssl libraries are. I tried --with-openssl=/usr --with-openssl-dir=/usr, etc, all were unrecognized options that I thought I'd used before compiling pervious ruby versions.
Thanks
Updated by bshelton (Bryan Shelton) almost 13 years ago
Removing the mac ports $PATH entries /opt/local/bin and /opt/local/sbin from my path and re-compiling worked for me. My guess is that removing /opt/local/bin/openssl from the path in lieu of /usr/bin/openssl is what's making it compile against the right libraries.
Updated by ccocchi (Christopher Cocchi) almost 13 years ago
Removing mac ports PATH entries and re-compiling also worked for me. Thanks!
Updated by naruse (Yui NARUSE) almost 13 years ago
- Status changed from Open to Closed