Project

General

Profile

Actions

Bug #4033

closed

Segmentation fault : ext/openssl:OpenSSL::X509::StoreContext#cleanup

Added by ohai (Ippei Obayashi) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
Backport:
[ruby-dev:42546]

Description

=begin
以下のコードがSegmentation faultで止まります。

require 'openssl'
cert = OpenSSL::X509::Certificate.new
store = OpenSSL::X509::Store.new
ctx = OpenSSL::X509::StoreContext.new(store, cert, [])
ctx.cleanup
ctx.verify

% ruby-1.9.2-p0 contextbug.rb
contextbug.rb:6: [BUG] Segmentation fault
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

-- control frame ----------
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :verify
c:0003 p:0109 s:0009 b:0009 l:000fd8 d:001ba0 EVAL contextbug.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000fd8 d:000fd8 TOP

-- Ruby level backtrace information ----------------------------------------
contextbug.rb:6:in <main>' contextbug.rb:6:in verify'

-- C level backtrace information -------------------------------------------
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_vm_bugreport+0x5f) [0x7f4d8aa1ec1f]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8a8fc0dc]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_bug+0xb3) [0x7f4d8a8fc253]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8a9ada9c]
/lib/libpthread.so.0 [0x7f4d8a689a80]
/usr/lib/libcrypto.so.0.9.8(X509_verify_cert+0x84) [0x7f4d84d3dfa4]
/home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/x86_64-linux/openssl.so [0x7f4d85246f37]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8aa18f1f]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8aa0cf09]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8aa13103]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9(rb_iseq_eval_main+0x27c) [0x7f4d8aa1347c]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9 [0x7f4d8a90029b]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9(ruby_exec_node+0x19) [0x7f4d8a9002c9]
/home/ohai/opt/ruby-1.9.2-p0/lib/libruby.so.1.9(ruby_run_node+0x1e) [0x7f4d8a901e0e]
ruby-1.9.2-p0(main+0x4f) [0x40099f]
/lib/libc.so.6(__libc_start_main+0xe6) [0x7f4d89a7e1a6]
ruby-1.9.2-p0 [0x400889]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

[1] 6994 abort ruby-1.9.2-p0 contextbug.rb

http://www.openssl.org/docs/crypto/X509_STORE_CTX_new.html によると、

X509_STORE_CTX_cleanup() internally cleans up an X509_STORE_CTX structure.
The context can then be reused with an new call to X509_STORE_CTX_init().

とのことです。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0