[MacRuby] #889: Bus error with OpenSSL::ASN1.decode.

MacRuby ruby-noreply at macosforge.org
Thu Sep 9 23:20:46 PDT 2010


#889: Bus error with OpenSSL::ASN1.decode.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Bus error with OpenSSL::ASN1.decode.

 Test Script:
 {{{
 #!ruby
 require "openssl"

 key = OpenSSL::PKey::RSA.new(1024)
 digest = OpenSSL::Digest::SHA1.new()

 issu = sub = OpenSSL::X509::Name.new()
 sub.add_entry('C', 'JP')
 sub.add_entry('ST', 'Shimane')
 sub.add_entry('CN', 'Ruby Taro')

 cer = OpenSSL::X509::Certificate.new()
 cer.not_before = Time.at(0)
 cer.not_after = Time.at(0)
 cer.public_key = key
 cer.serial = 1
 cer.issuer = issu
 cer.subject = sub

 p OpenSSL::ASN1.decode(cer.to_der)
 }}}

 Result of MacRuby Trunk:
 {{{
 DYLD_LIBRARY_PATH=. gdb --args ./macruby -I./lib -I./ext test_asn1.rb
 GNU gdb 6.3.50-20050815 (Apple version gdb-1469) (Wed May  5 04:36:56 UTC
 2010)
 Copyright 2004 Free Software Foundation, Inc.
 GDB is free software, covered by the GNU General Public License, and you
 are
 welcome to change it and/or distribute copies of it under certain
 conditions.
 Type "show copying" to see the conditions.
 There is absolutely no warranty for GDB.  Type "show warranty" for
 details.
 This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
 shared libraries ..... done

 (gdb) r
 Starting program: /Users/watson/src/MacRuby/macruby -I./lib -I./ext
 test_asn1.rb
 Reading symbols for shared libraries .++++.......................... done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries .... done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done
 Reading symbols for shared libraries . done

 Program received signal EXC_BAD_ACCESS, Could not access memory.
 Reason: KERN_PROTECTION_FAILURE at address: 0x000000010092d908
 0x00007fff81ff2023 in ASN1_put_object ()
 (gdb) bt
 #0  0x00007fff81ff2023 in ASN1_put_object ()
 #1  0x00007fff81fc707d in ASN1_item_ex_i2d ()
 #2  0x00007fff81fc77a9 in ASN1_item_i2d ()
 #3  0x00007fff81fac8f0 in i2d_X509 ()
 #4  0x0000000103d80815 in ossl_x509_to_der (self=8592150336) at
 ossl_x509cert.c:196
 #5  0x0000000100131e98 in __rb_vm_rcall [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:159
 #6  0x0000000100131e98 in ruby_dispatch [inlined] () at
 /Users/watson/src/MacRuby/dispatcher.cpp:453
 #7  0x0000000100131e98 in rb_vm_dispatch () at dispatcher.cpp:817
 #8  0x0000000101f069fc in ?? ()
 #9  0x0000000101f06592 in ?? ()
 #10 0x000000010014bab3 in rb_vm_run (fname=0x2000c0600 "test_asn1.rb",
 node=0x2000c5260, binding=0x0, inside_eval=false) at vm.cpp:3831
 #11 0x00000001000384e0 in ruby_run_node (n=0x2000c5260) at eval.c:211
 #12 0x0000000100000c15 in main (argc=4, argv=0x10171de70,
 envp=0x7fff5fbfe8a0) at main.cpp:40
 (gdb)
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/889>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list