#1051: Segfault occurs with RDoc::Parser::Ruby. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby require 'tempfile' require 'rdoc/options' require 'rdoc/parser/ruby' require 'rdoc/stats' def util_parser(content) @parser = RDoc::Parser::Ruby.new @top_level, @filename, content, @options, @stats end def util_top_level RDoc::TopLevel.reset @top_level = RDoc::TopLevel.new @filename @top_level2 = RDoc::TopLevel.new @filename2 end @tempfile = Tempfile.new self.class.name @filename = @tempfile.path # Some tests need two paths. @tempfile2 = Tempfile.new self.class.name @filename2 = @tempfile2.path util_top_level @options = RDoc::Options.new @options.quiet = true @stats = RDoc::Stats.new 0 util_parser "" comment = "# :section: new section\n# woo stuff\n" @parser.look_for_directives_in @top_level, comment section = @top_level.current_section p section.title p section.comment p comment }}} BackTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000024 0x00000001000abd50 in str_concat_string (self=0x2003ad780, str=0x4) at string.c:865 865 if (str->length_in_bytes == 0) { (gdb) bt #0 0x00000001000abd50 in str_concat_string (self=0x2003ad780, str=0x4) at string.c:865 #1 0x00000001000b2c2b in str_gsub (sel=0x100ec3c00, argc=1, argv=0x7fff5fbfcd38, str=8593931552, bang=true) at string.c:3917 #2 0x00000001000b31cb in rstr_gsub_bang (str=8593931552, sel=0x100ec3c00, argc=1, argv=0x7fff5fbfcd38) at string.c:4000 #3 0x0000000100136fb3 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:448 #4 0x0000000100136fb3 in rb_vm_dispatch () at dispatcher.cpp:849 #5 0x0000000103300e36 in ?? () #6 0x000000010335f494 in ?? () #7 0x00000001001375e6 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:161 #8 0x00000001001375e6 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:466 #9 0x00000001001375e6 in rb_vm_dispatch () at dispatcher.cpp:849 #10 0x0000000103300e36 in ?? () #11 0x000000010335e7e4 in ?? () #12 0x0000000100137627 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:163 #13 0x0000000100137627 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk-svn/dispatcher.cpp:466 #14 0x0000000100137627 in rb_vm_dispatch () at dispatcher.cpp:849 #15 0x0000000103300e36 in ?? () #16 0x0000000103300607 in ?? () #17 0x00000001001519cd in rb_vm_run (fname=0x20004f1e0 "/Users/watson/tmp/test_rdoc.rb", node=0x20005d580, binding=0x0, inside_eval=false) at vm.cpp:3928 #18 0x0000000100038479 in ruby_run_node (n=0x20005d580) at eval.c:211 #19 0x0000000100000c15 in main (argc=3, argv=0x100e1de30, envp=0x7fff5fbfee60) at main.cpp:40 Current language: auto; currently c (gdb) }}} By the following commands, could confirm this problem. {{{ On MacRuby source directory: $ cd test/test-mri/ $ macruby -r require_relative.rb test/rdoc/test_rdoc_parser_ruby.rb -v }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1051> MacRuby <http://macruby.org/>