[MacRuby-devel] [MacRuby] #604: EXC_BAD_ACCESS while opening stream

MacRuby ruby-noreply at macosforge.org
Mon Mar 29 19:16:36 PDT 2010


#604: EXC_BAD_ACCESS while opening stream
-----------------------------------+----------------------------------------
 Reporter:  jakub.suder@…          |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  critical               |   Milestone:                       
Component:  MacRuby                |    Keywords:                       
-----------------------------------+----------------------------------------

Comment(by martinlagardette@…):

 I just looked closely: the problem is that our `io.c` does the following:
 {{{
 #!c
     rb_objc_define_module_function(rb_mKernel, "open", rb_f_open, -1);
 }}}
 It defines the "open" method over `rb_mKernel`, which is the super class
 of every object, even NSObject! This is to allow code like:
 {{{
 #!ruby
 open("testfile") do |f|
     print f.gets
 end
 }}}
 This avoids the need to use `IO.open`.

 But this means that we supersede the original "open" from Obj-C, which is
 why our function gets called. I'm not sure yet what action should be
 taken. I'll discuss that with Laurent.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/604#comment:7>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list