emboss/krypt-core — Issue #27: Krypt::ASN1::EndOfContents.new causes SEGV
Author: nahi
Created: 2012-01-27 03:16:46+00:00
State: open

```
% ruby -Ilib -rkrypt-core -e 'Krypt::ASN1::EndOfContents.new(nil)'
-e:1: [BUG] Segmentation fault
ruby 2.0.0dev (2012-01-19 trunk 34340) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :initialize
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :new
c:0003 p:0020 s:0006 b:0006 l:001c18 d:0015f8 EVAL -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001c18 d:001c18 TOP

-- Ruby level backtrace information ----------------------------------------
-e:1:in `

'
-e:1:in `new'
-e:1:in `initialize'

-- C level backtrace information -------------------------------------------
/usr/local/lib/libruby.so.2.0(+0x17bfb5) [0x7fd9c8227fb5] ../vm_dump.c:812
/usr/local/lib/libruby.so.2.0(+0x5d01b) [0x7fd9c810901b] ../error.c:266
/usr/local/lib/libruby.so.2.0(rb_bug+0xb7) [0x7fd9c8109f97] ../error.c:285
/usr/local/lib/libruby.so.2.0(+0x11066f) [0x7fd9c81bc66f] ../signal.c:603
/lib/x86_64-linux-gnu/libc.so.6(+0x36420) [0x7fd9c7d43420]
/home/nahi/git/krypt-core/lib/kryptcore.so(+0xb463) [0x7fd9c643a463] ../../../../ext/krypt/core/krypt_asn1.c:234
/home/nahi/git/krypt-core/lib/kryptcore.so(+0xb678) [0x7fd9c643a678] ../../../../ext/krypt/core/krypt_asn1.c:319
/home/nahi/git/krypt-core/lib/kryptcore.so(+0xcfed) [0x7fd9c643bfed] ../../../../ext/krypt/core/krypt_asn1.c:345
/usr/local/lib/libruby.so.2.0(+0x172762) [0x7fd9c821e762] ../vm_eval.c:79
/usr/local/lib/libruby.so.2.0(rb_class_new_instance+0x30) [0x7fd9c8159970] ../object.c:1681
/usr/local/lib/libruby.so.2.0(+0x17532a) [0x7fd9c822132a] ../vm_insnhelper.c:452
/usr/local/lib/libruby.so.2.0(+0x16aba9) [0x7fd9c8216ba9] ../insns.def:1015
/usr/local/lib/libruby.so.2.0(+0x1714fa) [0x7fd9c821d4fa] ../vm.c:1217
/usr/local/lib/libruby.so.2.0(rb_iseq_eval_main+0xa6) [0x7fd9c8223826] ../vm.c:1459
/usr/local/lib/libruby.so.2.0(+0x62d42) [0x7fd9c810ed42] ../eval.c:204
/usr/local/lib/libruby.so.2.0(ruby_exec_node+0x1d) [0x7fd9c810fddd] ../eval.c:251
/usr/local/lib/libruby.so.2.0(ruby_run_node+0x1e) [0x7fd9c8111e0e] ../eval.c:244
ruby() [0x4007db]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fd9c7d2e30d]
ruby() [0x400809]

-- Other runtime information -----------------------------------------------

* Loaded script: -e

* Loaded features:

0 enumerator.so
1 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
2 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
3 /usr/local/lib/ruby/2.0.0/rubygems/defaults.rb
4 /usr/local/lib/ruby/2.0.0/x86_64-linux/rbconfig.rb
5 /usr/local/lib/ruby/2.0.0/rubygems/deprecate.rb
6 /usr/local/lib/ruby/2.0.0/rubygems/exceptions.rb
7 /usr/local/lib/ruby/2.0.0/rubygems/custom_require.rb
8 /usr/local/lib/ruby/2.0.0/rubygems.rb
9 /home/nahi/git/krypt-core/lib/kryptcore.so
10 /home/nahi/git/krypt-core/lib/krypt-core.rb

* Process memory map:

00400000-00401000 r-xp 00000000 08:01 5505867 /usr/local/bin/ruby
00600000-00601000 r--p 00000000 08:01 5505867 /usr/local/bin/ruby
00601000-00602000 rw-p 00001000 08:01 5505867 /usr/local/bin/ruby
01987000-01c29000 rw-p 00000000 00:00 0 [heap]
7fd9c6219000-7fd9c622e000 r-xp 00000000 08:01 134871 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd9c622e000-7fd9c642d000 ---p 00015000 08:01 134871 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd9c642d000-7fd9c642e000 r--p 00014000 08:01 134871 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd9c642e000-7fd9c642f000 rw-p 00015000 08:01 134871 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fd9c642f000-7fd9c6445000 r-xp 00000000 08:01 3436203 /home/nahi/git/krypt-core/lib/kryptcore.so
7fd9c6445000-7fd9c6644000 ---p 00016000 08:01 3436203 /home/nahi/git/krypt-core/lib/kryptcore.so
7fd9c6644000-7fd9c6645000 r--p 00015000 08:01 3436203 /home/nahi/git/krypt-core/lib/kryptcore.so
7fd9c6645000-7fd9c6647000 rw-p 00016000 08:01 3436203 /home/nahi/git/krypt-core/lib/kryptcore.so
7fd9c6647000-7fd9c664a000 rw-p 00000000 00:00 0
7fd9c664a000-7fd9c664c000 r-xp 00000000 08:01 4498600 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7fd9c664c000-7fd9c684c000 ---p 00002000 08:01 4498600 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7fd9c684c000-7fd9c684d000 r--p 00002000 08:01 4498600 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7fd9c684d000-7fd9c684e000 rw-p 00003000 08:01 4498600 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7fd9c684e000-7fd9c6850000 r-xp 00000000 08:01 4498592 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7fd9c6850000-7fd9c6a4f000 ---p 00002000 08:01 4498592 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7fd9c6a4f000-7fd9c6a50000 r--p 00001000 08:01 4498592 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7fd9c6a50000-7fd9c6a51000 rw-p 00002000 08:01 4498592 /usr/local/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7fd9c6a51000-7fd9c7227000 r--p 00000000 08:01 5118342 /usr/lib/locale/locale-archive
7fd9c7227000-7fd9c72aa000 r-xp 00000000 08:01 134880 /lib/x86_64-linux-gnu/libm-2.13.so
7fd9c72aa000-7fd9c74a9000 ---p 00083000 08:01 134880 /lib/x86_64-linux-gnu/libm-2.13.so
7fd9c74a9000-7fd9c74aa000 r--p 00082000 08:01 134880 /lib/x86_64-linux-gnu/libm-2.13.so
7fd9c74aa000-7fd9c74ab000 rw-p 00083000 08:01 134880 /lib/x86_64-linux-gnu/libm-2.13.so
7fd9c74ab000-7fd9c74b4000 r-xp 00000000 08:01 134856 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7fd9c74b4000-7fd9c76b4000 ---p 00009000 08:01 134856 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7fd9c76b4000-7fd9c76b5000 r--p 00009000 08:01 134856 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7fd9c76b5000-7fd9c76b6000 rw-p 0000a000 08:01 134856 /lib/x86_64-linux-gnu/libcrypt-2.13.so
7fd9c76b6000-7fd9c76e4000 rw-p 00000000 00:00 0
7fd9c76e4000-7fd9c76e6000 r-xp 00000000 08:01 134861 /lib/x86_64-linux-gnu/libdl-2.13.so
7fd9c76e6000-7fd9c78e6000 ---p 00002000 08:01 134861 /lib/x86_64-linux-gnu/libdl-2.13.so
7fd9c78e6000-7fd9c78e7000 r--p 00002000 08:01 134861 /lib/x86_64-linux-gnu/libdl-2.13.so
7fd9c78e7000-7fd9c78e8000 rw-p 00003000 08:01 134861 /lib/x86_64-linux-gnu/libdl-2.13.so
7fd9c78e8000-7fd9c78ef000 r-xp 00000000 08:01 134914 /lib/x86_64-linux-gnu/librt-2.13.so
7fd9c78ef000-7fd9c7aee000 ---p 00007000 08:01 134914 /lib/x86_64-linux-gnu/librt-2.13.so
7fd9c7aee000-7fd9c7aef000 r--p 00006000 08:01 134914 /lib/x86_64-linux-gnu/librt-2.13.so
7fd9c7aef000-7fd9c7af0000 rw-p 00007000 08:01 134914 /lib/x86_64-linux-gnu/librt-2.13.so
7fd9c7af0000-7fd9c7b08000 r-xp 00000000 08:01 134910 /lib/x86_64-linux-gnu/libpthread-2.13.so
7fd9c7b08000-7fd9c7d07000 ---p 00018000 08:01 134910 /lib/x86_64-linux-gnu/libpthread-2.13.so
7fd9c7d07000-7fd9c7d08000 r--p 00017000 08:01 134910 /lib/x86_64-linux-gnu/libpthread-2.13.so
7fd9c7d08000-7fd9c7d09000 rw-p 00018000 08:01 134910 /lib/x86_64-linux-gnu/libpthread-2.13.so
7fd9c7d09000-7fd9c7d0d000 rw-p 00000000 00:00 0
7fd9c7d0d000-7fd9c7ea2000 r-xp 00000000 08:01 134850 /lib/x86_64-linux-gnu/libc-2.13.so
7fd9c7ea2000-7fd9c80a1000 ---p 00195000 08:01 134850 /lib/x86_64-linux-gnu/libc-2.13.so
7fd9c80a1000-7fd9c80a5000 r--p 00194000 08:01 134850 /lib/x86_64-linux-gnu/libc-2.13.so
7fd9c80a5000-7fd9c80a6000 rw-p 00198000 08:01 134850 /lib/x86_64-linux-gnu/libc-2.13.so
7fd9c80a6000-7fd9c80ac000 rw-p 00000000 00:00 0
7fd9c80ac000-7fd9c82c6000 r-xp 00000000 08:01 5512050 /usr/local/lib/libruby.so.2.0.0
7fd9c82c6000-7fd9c84c5000 ---p 0021a000 08:01 5512050 /usr/local/lib/libruby.so.2.0.0
7fd9c84c5000-7fd9c84ca000 r--p 00219000 08:01 5512050 /usr/local/lib/libruby.so.2.0.0
7fd9c84ca000-7fd9c84ce000 rw-p 0021e000 08:01 5512050 /usr/local/lib/libruby.so.2.0.0
7fd9c84ce000-7fd9c84ea000 rw-p 00000000 00:00 0
7fd9c84ea000-7fd9c850b000 r-xp 00000000 08:01 134837 /lib/x86_64-linux-gnu/ld-2.13.so
7fd9c85ef000-7fd9c86f5000 rw-p 00000000 00:00 0
7fd9c86fc000-7fd9c86fd000 rw-p 00000000 00:00 0
7fd9c86fd000-7fd9c8704000 r--s 00000000 08:01 5506893 /usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7fd9c8704000-7fd9c8705000 ---p 00000000 00:00 0
7fd9c8705000-7fd9c870a000 rw-p 00000000 00:00 0
7fd9c870a000-7fd9c870b000 r--p 00020000 08:01 134837 /lib/x86_64-linux-gnu/ld-2.13.so
7fd9c870b000-7fd9c870d000 rw-p 00021000 08:01 134837 /lib/x86_64-linux-gnu/ld-2.13.so
7fffcd8f6000-7fffcd917000 rw-p 00000000 00:00 0 [stack]
7fffcd9ff000-7fffcda00000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

[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
```