[MacRuby] #1243: Segfault occurs in rb_vm_const_lookup_level when use Webrick.
#1243: Segfault occurs in rb_vm_const_lookup_level when use Webrick. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- I launch a Webrick server and crash when I browse the URL that there is 404 of HTTP status. Test Script: {{{ #!ruby require 'open-uri' require 'webrick' def with_http Dir.mktmpdir {|dr| srv = WEBrick::HTTPServer.new({ :DocumentRoot => dr, :ServerType => Thread, :BindAddress => '127.0.0.1', :Port => 0}) _, port, _, host = srv.listeners[0].addr begin th = srv.start yield srv, dr, "http://#{host}:#{port}" ensure srv.shutdown end } end with_http {|srv, dr, url| begin open("#{url}/not-exist") {} rescue end } }}} BackTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x000000000000000c [Switching to process 38895 thread 0x2407] 0x000000010013fed8 in rb_vm_const_lookup_level (outer=8590901440, outer_mask=0, path=24885, lexical=true, defined=false, outer_stack=0x4) at vm.cpp:1317 1317 while (root_outer != NULL && root_outer->pushed_by_eval) { (gdb) bt #0 0x000000010013fed8 in rb_vm_const_lookup_level (outer=8590901440, outer_mask=0, path=24885, lexical=true, defined=false, outer_stack=0x4) at vm.cpp:1317 #1 0x00000001016011f6 in ?? () #2 0x000000010012ddb8 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #3 0x000000010012ddb8 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #4 0x000000010012ddb8 in rb_vm_dispatch () at dispatcher.cpp:872 #5 0x0000000101600514 in ?? () #6 0x000000010164162e in ?? () #7 0x000000010012ddb8 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #8 0x000000010012ddb8 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #9 0x000000010012ddb8 in rb_vm_dispatch () at dispatcher.cpp:872 #10 0x0000000101600514 in ?? () #11 0x0000000107eb1d80 in ?? () #12 0x000000010012de2b in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:163 #13 0x000000010012de2b in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #14 0x000000010012de2b in rb_vm_dispatch () at dispatcher.cpp:872 #15 0x0000000101600514 in ?? () #16 0x00000001016597ba in ?? () #17 0x000000010012ddea in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:161 #18 0x000000010012ddea in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #19 0x000000010012ddea in rb_vm_dispatch () at dispatcher.cpp:872 #20 0x0000000101600514 in ?? () #21 0x0000000101671895 in ?? () #22 0x000000010013216b in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #23 0x000000010013216b in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1221 #24 0x000000010013216b in rb_vm_block_eval (b=0x200437360, argc=0, argv=0x0) at dispatcher.cpp:1228 #25 0x000000010014bbfb in rb_vm_thread_run (thread=8594308000) at vm.cpp:4740 #26 0x00007fff85d534f6 in _pthread_start () #27 0x00007fff85d533a9 in thread_start () (gdb) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1243> MacRuby <http://macruby.org/>
#1243: Segfault occurs in rb_vm_const_lookup_level when use Webrick. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): I fixed the segfault crash in master but the problem is not solved yet, it still fails with a const lookup error. I was able to reduce the problem to: {{{ $ ./miniruby -e "module M; eval('FOO=42; class X; def foo; FOO; end; end'); end; p M::X.new.foo" -e:1:in `<main>': uninitialized constant M::X::FOO (NameError) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1243#comment:1> MacRuby <http://macruby.org/>
#1243: Segfault occurs in rb_vm_const_lookup_level when use Webrick. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by kouji@…): I fixed this in https://github.com/MacRuby/MacRuby/commit/fbaff4e856e686792775da89e660acc163... . Could you close this? -- Ticket URL: <http://www.macruby.org/trac/ticket/1243#comment:2> MacRuby <http://macruby.org/>
#1243: Segfault occurs in rb_vm_const_lookup_level when use Webrick. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.11 Comment: Verified, closing. -- Ticket URL: <http://www.macruby.org/trac/ticket/1243#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby