Re: CFReadStreamOpen() crashes on the main thread
Re: CFReadStreamOpen() crashes on the main thread
- Subject: Re: CFReadStreamOpen() crashes on the main thread
- From: Jens Alfke <email@hidden>
- Date: Tue, 27 Jan 2015 11:00:20 -0800
Please don’t post ridiculously long listings / logs to a mailing list. That’s just basic netiquette! You can upload them to something like Gist or Pastebin or whatever, and post a link. Or in this case you can snip the log down to just the immediate backtrace of the thread that crashed.
So here’s the important bit:
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 libobjc.A.dylib 0x00007fff8787339f objc_msgSend_fixup + 95
> 1 com.apple.CoreFoundation 0x00007fff8aa86d75 CFURLCreateStringByAddingPercentEscapes + 69
Any time you see a crash in objc_msgSend or a similarly-named function, it implies a message was sent to a bad object. Most often that’s because the object has already been deallocated, i.e. you have a ref-counting problem. (Sometimes it happens because the object pointer itself is garbage, or because there’s a memory smasher that overwrote the object, but that’s less common.)
Since the caller is CFURLCreateStringByAddingPercentEscapes, presumably the input string to that function is bad. And since CFNetwork doesn’t have known ref-counting bugs, you’ve probably over-released some CFString in your code. (Here I have to echo Quinn’s point: if you used Objective-C, especially with ARC, the ref-counting would be a lot easier.)
Using NSZombies is the best way to get more information. Search the reference docs for more info.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden