#1225: Segfault occurs when override the @sock.shutdown in NET::IMAP. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby require "net/imap" SERVER_ADDR = "127.0.0.1" server = TCPServer.new(SERVER_ADDR, 0) port = server.addr[1] Thread.start do ssock = server.accept ssock.print("* OK test server\r\n") end imap = Net::IMAP.new(SERVER_ADDR, port) imap.instance_eval do puts "** override shutdown" def @sock.shutdown(*how) end end puts "** done" }}} {{{ $ ruby19 t.rb ** override shutdown ** done $ macruby t.rb ** override shutdown zsh: segmentation fault macruby t.rb }}} BackTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000018 [Switching to process 1051 thread 0x2b0b] 0x0000000100892790 in llvm::Calculate<llvm::Function, llvm::BasicBlock*> () (gdb) bt #0 0x0000000100892790 in llvm::Calculate<llvm::Function, llvm::BasicBlock*> () #1 0x0000000100894201 in llvm::DominatorTreeBase<llvm::BasicBlock>::recalculate<llvm::Function> () #2 0x000000010088f08d in llvm::DominatorTree::runOnFunction () #3 0x0000000100901aa0 in llvm::FPPassManager::runOnFunction () #4 0x0000000100901c3c in llvm::FunctionPassManagerImpl::run () #5 0x0000000100901f29 in llvm::FunctionPassManager::run () #6 0x000000010013f89d in RoxorCore::optimize (this=0x102068200, func=0x10151f540) at vm.cpp:543 #7 0x000000010013f916 in RoxorCore::compile (this=0x102068200, func=0x10151f540, run_optimize=true) at vm.cpp:577 #8 0x0000000100143268 in RoxorCore::resolve_method (this=0x102068200, klass=0x200220bc0, sel=0x101503310, func=0x10151f540, arity=@0x10490ee48, flags=2, imp=0, m=0x0, objc_imp_types=0x0) at vm.cpp:1867 #9 0x000000010014366d in RoxorCore::resolve_methods (this=0x102068200, map=0x1011bc210, klass=0x200220bc0, sel=0x101503310) at vm.cpp:1946 #10 0x000000010014484f in rb_vm_resolve_method (klass=0x200220bc0, sel=0x101503310) at vm.cpp:2006 #11 0x00000001001448ad in resolveInstanceMethod_imp (self=0x2000f50a0, sel=0x7fff819d0585, name=0x101503310) at vm.cpp:4920 #12 0x00007fff86969937 in _class_resolveMethod () #13 0x000000010012b02e in rb_vm_dispatch () at dispatcher.cpp:635 #14 0x0000000101600d74 in ?? () #15 0x00000001016033a2 in ?? () #16 0x000000010012c444 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #17 0x000000010012c444 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #18 0x000000010012c444 in rb_vm_dispatch () at dispatcher.cpp:863 #19 0x0000000101600d74 in ?? () #20 0x0000000101602aa0 in ?? () #21 0x000000010012c444 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #22 0x000000010012c444 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #23 0x000000010012c444 in rb_vm_dispatch () at dispatcher.cpp:863 #24 0x000000010129ba55 in md5 () #25 0x00000001012adca6 in MREP_97B206DE041042B78F82683BD0596131 () #26 0x000000010012c444 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #27 0x000000010012c444 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #28 0x000000010012c444 in rb_vm_dispatch () at dispatcher.cpp:863 #29 0x000000010129ba55 in md5 () #30 0x00000001012ad90c in MREP_97B206DE041042B78F82683BD0596131 () #31 0x00000001001307f3 in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #32 0x00000001001307f3 in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1212 #33 0x00000001001307f3 in rb_vm_block_eval (b=0x20020d600, argc=0, argv=0x0) at dispatcher.cpp:1219 #34 0x0000000100149985 in rb_vm_thread_run (thread=8590747520) at vm.cpp:4577 #35 0x00007fff85d534f6 in _pthread_start () #36 0x00007fff85d533a9 in thread_start () }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1225> MacRuby <http://macruby.org/>