Bug #8673

User rest-client PUT request core dumped

Added by Hao Wei 9 months ago. Updated 6 months ago.

[ruby-core:56127]
Status:Open
Priority:Normal
Assignee:Martin Bosslet
Category:core
Target version:-
ruby -v:ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

  1. use OpenSSL::X509::Certificate.new generate certificate object
  2. create client = RestClient::Resource.new object
  3. use client PUT request, then server crashed
    code is like as below:
    certificate = OpenSSL::X509::Certificate.new(File.read('file.pem'))

    client = RestClient::Resource.new(URL,
    :sslclientcert => certificate,
    :sslclientkey => certificate.publickey,
    :verify
    ssl => OpenSSL::SSL::VERIFYPEER,
    :ssl
    cafile => 'ca-cert.pem')
    response = client.put(xml.to
    xml, :content_type =>"application/xml")

crash_log.log (253 KB) Hao Wei, 07/23/2013 10:06 PM

History

#1 Updated by Hao Wei 9 months ago

/home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/openssl/buffering.rb:174: [BUG] Segmentation fault
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]

-- Control frame information -----------------------------------------------
c:0152 p:---- s:0787 e:000786 CFUNC :sysreadnonblock
c:0151 p:0067 s:0782 e:000781 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/openssl/buffering.rb:174
c:0150 p:0021 s:0776 e:000774 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/protocol.rb:153
c:0149 p:0021 s:0772 e:000771 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/protocol.rb:134
c:0148 p:0009 s:0766 e:000765 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/protocol.rb:144
c:0147 p:0008 s:0763 e:000762 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/response.rb:39
c:0146 p:0009 s:0757 e:000756 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http/response.rb:28
c:0145 p:0044 s:0749 e:000748 BLOCK /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1406 [FINISH]
c:0144 p:---- s:0747 e:000746 CFUNC :catch
c:0143 p:0024 s:0743 e:000742 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1403
c:0142 p:0061 s:0736 e:000735 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1376
c:0141 p:0055 s:0729 e:000728 METHOD /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/net
httpext.rb:51
c:0140 p:0052 s:0723 E:fffff6dc BLOCK /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/request.rb:176
c:0139 p:0044 s:0719 e:000718 METHOD /home/hao/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:852
c:0138 p:0269 s:0716 E:fffffd98 METHOD /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/request.rb:172
c:0137 p:0039 s:0708 e:000707 METHOD /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/request.rb:64
c:0136 p:0013 s:0703 e:000702 METHOD /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/request.rb:33
c:0135 p:0075 s:0698 e:000697 METHOD /home/hao/.rvm/gems/ruby-2.0.0-p247/gems/rest-client-1.6.7/lib/restclient/resource.rb:76
c:0134 p:0105 s:0691 e:000690 METHOD /home/hao/Work/fi-ware-idm/app/models/xacml
policy.rb:81

#2 Updated by Charlie Somerville 8 months ago

  • Priority changed from Urgent to Normal

#3 Updated by McClain Looney 8 months ago

I'm seeing regular segfaults along this code path without any fancy ssl-related stuff.

Interestingly, it's blowing up during a spec run, and when I run the segfaulting specification alone, it doesn't segfault.

c:0042 p:---- s:0186 e:000185 CFUNC :read_nonblock
c:0041 p:0021 s:0182 e:000180 METHOD /usr/local/lib/ruby/2.0.0/net/protocol.rb:153
c:0040 p:0077 s:0178 e:000177 METHOD /usr/local/lib/ruby/2.0.0/net/protocol.rb:104
c:0039 p:0058 s:0170 e:000169 BLOCK /usr/local/lib/ruby/2.0.0/net/http/response.rb:284
c:0038 p:0117 s:0166 e:000165 METHOD /usr/local/lib/ruby/2.0.0/net/http/response.rb:269
c:0037 p:0007 s:0162 e:000161 METHOD /usr/local/lib/ruby/2.0.0/net/http/response.rb:274
c:0036 p:0082 s:0158 e:000157 METHOD /usr/local/lib/ruby/2.0.0/net/http/response.rb:201
c:0035 p:0007 s:0152 e:000151 METHOD /usr/local/lib/ruby/2.0.0/net/http/response.rb:226
c:0034 p:0039 s:0149 e:000148 METHOD /usr/local/lib/ruby/2.0.0/net/http/response.rb:163
c:0033 p:0096 s:0144 e:000143 BLOCK /usr/local/lib/ruby/2.0.0/net/http.rb:1412 [FINISH]
c:0032 p:---- s:0142 e:000141 CFUNC :catch
c:0031 p:0024 s:0138 e:000137 METHOD /usr/local/lib/ruby/2.0.0/net/http.rb:1403
c:0030 p:0061 s:0131 e:000130 METHOD /usr/local/lib/ruby/2.0.0/net/http.rb:1376
c:0029 p:0036 s:0124 e:000123 BLOCK /usr/local/lib/ruby/2.0.0/net/http.rb:1369
c:0028 p:0044 s:0122 e:000121 METHOD /usr/local/lib/ruby/2.0.0/net/http.rb:852
c:0027 p:0017 s:0119 e:000118 METHOD /usr/local/lib/ruby/2.0.0/net/http.rb:1367
c:0026 p:0030 s:0112 E:001a68 METHOD /home/bby/.gem/ruby/2.0.0/gems/httparty-0.11.0/lib/httparty/request.rb:92

#4 Updated by Eric Hodel 8 months ago

  • Assignee set to Martin Bosslet

Can you include your OpenSSL version? For example, mine is:

$ ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
"OpenSSL 1.0.1e 11 Feb 2013"

#5 Updated by Hao Wei 6 months ago

the version is:
"OpenSSL 1.0.1c 10 May 2012"

Also available in: Atom PDF