[MacRuby] #1131: Abort: exception is not caught when open the file which is not existing in at_exit block.

MacRuby ruby-noreply at macosforge.org
Wed Jan 26 18:41:48 PST 2011


#1131: Abort: exception is not caught when open the file which is not existing in
at_exit block.
----------------------------------+-----------------------------------------
 Reporter:  watson1978@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:                       
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 Test Script:
 {{{
 #!ruby
 at_exit do
   f = File.open("not_exist.txt")
 end
 }}}

 Result:
 {{{
 $  macruby test.rb
 uncaught Objective-C/C++ exception...
 2011-01-27 11:37:08.433 macruby[2094:903] *** Terminating app due to
 uncaught exception 'Errno::ENOENT', reason:
 '/Users/watson/tmp/test.rb:2:in `block': No such file or directory -
 open() failed (Errno::ENOENT)
 '
 *** Call stack at first throw:
 (
         0   CoreFoundation                      0x00007fff8656f7b4
 __exceptionPreprocess + 180
         1   libobjc.A.dylib                     0x00007fff81d330f3
 objc_exception_throw + 45
         2   libmacruby.dylib                    0x0000000100161f05
 rb_vm_raise + 437
         3   libmacruby.dylib                    0x00000001000408d9
 rb_exc_raise + 9
         4   libmacruby.dylib                    0x000000010003e421
 rb_sys_fail + 161
         5   libmacruby.dylib                    0x000000010005a753
 rb_f_open + 1971
         6   libmacruby.dylib                    0x000000010014c06c
 rb_vm_dispatch + 7676
         7   libmacruby.dylib                    0x000000010006fdca
 rb_class_new_instance + 538
         8   libmacruby.dylib                    0x0000000100057178
 rb_io_binmode + 1224
         9   libmacruby.dylib                    0x000000010014c06c
 rb_vm_dispatch + 7676
         10  ???                                 0x0000000102d5a436 0x0 +
 4342522934
         11  ???                                 0x0000000102d5a84e 0x0 +
 4342523982
         12  libmacruby.dylib                    0x000000010014d6f9
 rb_vm_block_eval + 1401
         13  libmacruby.dylib                    0x000000010016020a
 rb_rescue2 + 58
         14  libmacruby.dylib                    0x00000001000411d0
 ruby_finalize + 96
         15  libmacruby.dylib                    0x00000001000a2d20 rb_exit
 + 16
         16  macruby                             0x0000000100000d2f main +
 159
         17  macruby                             0x0000000100000c88 start +
 52
 )
 terminate called after throwing an instance of 'NSException'
 zsh: abort      macruby test.rb
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1131>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list