[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26133] [ruby:trunk] yaml access invalid memory area

From: Tanaka Akira <akr@...>
Date: 2009-10-16 23:41:03 UTC
List: ruby-core #26133
YAML generates error message with a garbage as :

% ./ruby -ryaml -ve 'YAML.load("a: b\n" + "c"*100)' |& cat -v
ruby 1.9.2dev (2009-10-17 trunk 25379) [i686-linux]
/home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load': syntax error on line 1, col 100: `M-<^\^T^HM-AM-^?M-^?M-^?,M-r^S^H^B' (ArgumentError)
        from /home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load'
        from -e:1:in `<main>'

% ./ruby -ryaml -ve 'YAML.load("a: b\n" + "c"*100)' |& cat -v
ruby 1.9.2dev (2009-10-17 trunk 25379) [i686-linux]
/home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load': syntax error on line 1, col 100: `,M-r^S^H^F' (ArgumentError)
        from /home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load'
        from -e:1:in `<main>'

It seems yaml access invalid memory area.

% valgrind ./ruby -ryaml -ve 'YAML.load("a: b\n" + "c"*100)'          
==29218== Memcheck, a memory error detector.
==29218== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==29218== Using LibVEX rev 1854, a library for dynamic binary translation.
==29218== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==29218== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework.
==29218== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==29218== For more details, rerun with: -v
==29218== 
ruby 1.9.2dev (2009-10-17 trunk 25379) [i686-linux]
==29218== Invalid read of size 1
==29218==    at 0x4024478: strlen (mc_replace_strmem.c:242)
==29218==    by 0x80F067E: BSD_vfprintf (vsnprintf.c:919)
==29218==    by 0x80F1E60: rb_enc_vsprintf (sprintf.c:1156)
==29218==    by 0x80F1EFA: rb_vsprintf (sprintf.c:1179)
==29218==    by 0x8184CEC: rb_raise (error.c:1148)
==29218==    by 0x4867874: rb_syck_err_handler (rubyext.c:680)
==29218==    by 0x48790DF: syckerror (token.re:1153)
==29218==    by 0x487AFFC: syckparse (gram.c:1743)
==29218==    by 0x486E155: syck_parse (syck.c:512)
==29218==    by 0x4867E62: syck_parser_load (rubyext.c:864)
==29218==    by 0x8146497: call_cfunc (vm_insnhelper.c:286)
==29218==    by 0x8146346: vm_call_cfunc (vm_insnhelper.c:386)
==29218==  Address 0x4d0c94c is 4 bytes before a block of size 44 alloc'd
==29218==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==29218==    by 0x806351F: vm_xmalloc (gc.c:656)
==29218==    by 0x80636CD: ruby_xmalloc2 (gc.c:746)
==29218==    by 0x80636E7: ruby_xcalloc (gc.c:752)
==29218==    by 0x80F213C: st_init_table_with_size (st.c:191)
==29218==    by 0x80F2176: st_init_table (st.c:201)
==29218==    by 0x80F218A: st_init_numtable (st.c:207)
==29218==    by 0x8125D38: generic_ivar_set (variable.c:861)
==29218==    by 0x812678A: rb_ivar_set (variable.c:1103)
==29218==    by 0x4867C20: syck_parser_initialize (rubyext.c:807)
==29218==    by 0x8146497: call_cfunc (vm_insnhelper.c:286)
==29218==    by 0x8149202: vm_call0 (vm_eval.c:76)
/home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load': syntax error on line 1, col 100: `' (ArgumentError)
        from /home/ruby/tcio/lib/ruby/1.9.1/yaml.rb:133:in `load'
        from -e:1:in `<main>'
==29218== 
==29218== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 35 from 1)
==29218== malloc/free: in use at exit: 604,203 bytes in 19,965 blocks.
==29218== malloc/free: 43,046 allocs, 23,081 frees, 6,876,763 bytes allocated.
==29218== For counts of detected errors, rerun with: -v
==29218== searching for pointers to 19,965 not-freed blocks.
==29218== checked 502,544 bytes.
==29218== 
==29218== LEAK SUMMARY:
==29218==    definitely lost: 416,830 bytes in 13,714 blocks.
==29218==      possibly lost: 404 bytes in 2 blocks.
==29218==    still reachable: 186,969 bytes in 6,249 blocks.
==29218==         suppressed: 0 bytes in 0 blocks.
==29218== Rerun with --leak-check=full to see details of leaked memory.
-- 
Tanaka Akira

In This Thread

Prev Next