Bug #8673

User rest-client PUT request core dumped

Added by gabrielwei (Hao Wei) almost 5 years ago. Updated over 1 year ago.

Target version:
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux]


  1. use generate certificate object
  2. create client = object
  3. use client PUT request, then server crashed
    code is like as below:
    certificate ='file.pem'))

    client =,
    :ssl_client_cert => certificate,
    :ssl_client_key => certificate.public_key,
    :verify_ssl => OpenSSL::SSL::VERIFY_PEER,
    :ssl_ca_file => 'ca-cert.pem')
    response = client.put(xml.to_xml, :content_type =>"application/xml")

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


#1 [ruby-core:56128] Updated by gabrielwei (Hao Wei) almost 5 years 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 :sysread_nonblock
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_http_ext.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 [ruby-core:56380] Updated by charliesome (Charlie Somerville) almost 5 years ago

  • Priority changed from 6 to Normal

#3 [ruby-core:56775] Updated by mml (McClain Looney) almost 5 years 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 [ruby-core:56778] Updated by drbrain (Eric Hodel) almost 5 years ago

  • Assignee set to MartinBosslet (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 [ruby-core:57663] Updated by gabrielwei (Hao Wei) over 4 years ago

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

#6 Updated by zzak (Zachary Scott) almost 3 years ago

  • Assignee changed from MartinBosslet (Martin Bosslet) to openssl

#7 [ruby-core:76241] Updated by rhenium (Kazuki Yamaguchi) almost 2 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
  • Status changed from Open to Closed

I reproduced it. Thanks.

I believe McClain's is another bug. If it still occurs, could you make a new ticket with more information?

#8 [ruby-core:76714] Updated by usa (Usaku NAKAMURA) almost 2 years ago

  • Status changed from Closed to Feedback

#9 [ruby-core:77740] Updated by rhenium (Kazuki Yamaguchi) over 1 year ago

  • Status changed from Feedback to Closed

Fixed by 66c1da57eb03 at new upstream1 and imported by r56027 ("import Ruby/OpenSSL 2.0.0.beta.1").

Also available in: Atom PDF