Re: Cocoa newb - Bus Error from TCP Server
Re: Cocoa newb - Bus Error from TCP Server
- Subject: Re: Cocoa newb - Bus Error from TCP Server
- From: "Christopher Bland" <email@hidden>
- Date: Mon, 12 Jun 2006 00:09:53 GMT
Well...I thought I had solved it. Running it through the debugger kept telling me:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xbf806ffc
0xffff0b36 in ___memcpy () at /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h:186
186 /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h: No such file or directory.
in /System/Library/Frameworks/System.framework/PrivateHeaders/i386/cpu_capabilities.h
I'm using an Intel based iMac and OS X 10.4.6 and Xcode 2.3.
I thought all I had to do was make some soft-links and I'd be done, but that wasn't the case. I'm still trying to figure out what the heck is going on. Instead I think it is a problem with the NSInputStream read function returning -1. I'm trying to figure out why it is returning -1 (and what a -1 return value means).
I'm using the CocoaSOAP example from the Apple Developer website (which I changed a bit, simply copying and pasting code to get a response for a particular request). My client machine is a Windows box running my custom C app using libcurl to do the POST and get the response from the server.
I've traced the processing to the following:
HTTP request comes in fine
I pull the body and determine what is being POST'ed
I create and send back a 400/Bad Request with a message in the body
enter processIncomingBytes - then return (** See Note below)
enter stream - then return;
enter stream - call processOutgoingBytes
return from processOutgoingBytes, return from stream
enter stream - call processOutgoingBytes
return from processOutgoingBytes, return from stream
enter stream - call processOutgoingBytes
**** ERROR HAPPENS SOMEWHERE IN processOutgoingBytes ****
During the stream call before calling processIncomingBytes it makes a call to NSInputStream read and it returns -1. The doc'n doesn't indicate what a negative return value is.
I've grown quite frustrated over this because other things work fine like using the SOAP Mac client bundled with the example and I can even request pages through the GET method. For some reason doing an HTTP post with libcurl is killing the app.
If I did not explain something good enough please let me know and I'll do my best to elaborate. At this point everything is mushing together and I've tried my best to describe everything completely.
If there are any other suggestions I'm open to just about anything. In the mean time I'm going to check out my client app.
Chris
________________________________________________________________________
Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 1GB of Email Storage.
Visit http://www.juno.com/value to sign up today!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden