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

MacRuby ruby-noreply at macosforge.org
Fri Feb 5 13:36:16 PST 2010


#604: EXC_BAD_ACCESS while opening stream
-----------------------------------+----------------------------------------
 Reporter:  jakub.suder@…          |       Owner:  lsansonetti@…        
     Type:  defect                 |      Status:  new                  
 Priority:  critical               |   Milestone:                       
Component:  MacRuby                |    Keywords:                       
-----------------------------------+----------------------------------------
 I've recently started a new project using MacRuby 0.5, in which I have
 some classes in ObjC brought from another project. These classes are used
 for connecting to a web service, and they use the ASIHTTPRequest library
 to make HTTP requests.

 Now, as long as I'm only sending GET requests everything is fine, but once
 I send a POST request with non-empty body, I get a EXC_BAD_ACCESS error.
 The error appears when I call ASIHTTPRequest and it in turn calls
 CFReadStreamOpen, but in the end the backtrace leads to internal Ruby
 methods:

 {{{
 #0      0x100080dba in rb_scan_args
 #1      0x1000aed31 in rb_file_open
 #2      0x1001b5316 in rb_vm_call_with_cache2
 #3      0x1000c9652 in rb_class_new_instance
 #4      0x1000ac32d in rb_f_open
 #5      0x7fff851187ea in CFReadStreamOpen
 #6      0x7fff853b026e in HTTPNetConnection::prepareTransmission
 #7      0x7fff853af530 in NetConnection::enqueue
 #8      0x7fff853af409 in _CFNetConnectionEnqueue
 #9      0x7fff853af392 in HTTPNetStreamInfo::streamOpen
 #10     0x7fff853af354 in CFNetworkReadStream::httpStreamOpen
 #11     0x7fff85108036 in _CFStreamOpen
 #12     0x7fff851187c6 in CFReadStreamOpen
 #13     0x7fff85404421 in HTTPReadStream::startRequest
 #14     0x7fff85405814 in HTTPReadStream::streamOpen
 #15     0x7fff853af354 in CFNetworkReadStream::httpStreamOpen
 #16     0x7fff85108036 in _CFStreamOpen
 #17     0x7fff851187c6 in CFReadStreamOpen
 #18     0x10000a2e1 in -[ASIHTTPRequest startRequest] at
 ASIHTTPRequest.m:975
 #19     0x1000080f8 in -[ASIHTTPRequest main] at ASIHTTPRequest.m:620
 #20     0x100007ae0 in -[ASIHTTPRequest startAsynchronous] at
 ASIHTTPRequest.m:542
 (...)
 }}}

 The same code works perfectly well if I replace the macruby_main line in
 main.c with one that runs the ObjC version of NSApplication.

 I've tried the nightly version of Macruby but no change...

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



More information about the MacRuby-devel mailing list