Strange errors

Member
Posts: 215
Joined: 2008.06
Post: #31
AnotherJake Wrote:So, anyway, getting back to the topic...



That does indeed sound very strange. This is probably going to sound even stranger, but have you tried rebooting your machine lately to see if that helps? Because to me, it sounds like it *might* be an OS bug of some sort, on the outside of it.

Good idea, but yes, I have tried rebooting and I even reinstalled XCode to make sure. It's still flopping at seemingly random intervals. I will be running some more intensive checks here soon, I'll be sure to keep you guys up to date.

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #32
Well, this KERN_INVALID_ADDRESS and KERN_PROTECTION_FAILURE are stomping on my last nerve. This is so FRUSTRATING I can't even see straight. And with things in place, I can't get the help I need. I wish I could contact an Apple rep directly. And as long as I'm wishing for things: I wish I had a Lambo, could fly, and didn't need pills to help me sleep. MRAH!

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #33
Talyn Wrote:I wish I could contact an Apple rep directly.

Deric Horn
Public Development Representative
deric (at) apple.com
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #34
Good luck getting a response back. Wink

(yes, I've tried...)
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #35
Well if it a legit bug the proper thing to do would be to open up a radar ticket on it, bugreport.apple.com/
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #36
Since you also brought up the bug reporter, the bug *I* tried to get in contact with Apple about *was* resolved, although I received absolutely ZERO communications through either the radar channel or email *at all* -- none zero zilch zippo, like talking to a black hole...

I apologize for continuing to harp on this subject (because it just gets annoying after a while...), but as long as they're making it unreasonably hard on us to not only communicate with each other about their product(s), or more importantly, to communicate with Them about their products, then there is no reason for me not to voice my negative experiences about it.
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #37
Any idea why I keep getting Object Does Not Recognize selector errors for objects that are not called with that selector? It seems to get confused at random. It will randomly mix a method call with some other object I have instantiated, and it, of course, dies when this happens. It doesn't seem to be regular other than the fact that it keeps happening, however random. Any idea why it would call an object that is not specified in the code?

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2006.10
Post: #38
Quote:Any idea why I keep getting Object Does Not Recognize selector errors for objects that are not called with that selector?

As was previously mentioned, this will happen when you try to message a deallocated object. You have a pointer to the memory where your object used to be, but that memory is now occupied by (in this case) a different object of a different class.

Again, I highly recommend enabling zombies and seeing what happens. That will tell you the class of the deallocated object, its address, and who's trying to talk to it.

In case you don't know how to enable zombies:

1. Xcode "Project" Menu->Edit Active Executable
2. Select the arguments tab
3. In the "Variables to be set in the environment" list, add a new item whose name is "NSZombieEnabled" and whose value is "YES".

Also, it's highly unlikely that the over-release is occurring in system code. Don't fall back on that assumption until you've at least gone through the basic debugging steps, which include making use of the NSZombieEnabled, CFZombieLevel, MallocPreScribble, MallocScribble, and MallocGuardEdges environment variables, as well as inserting the libgmalloc library with MALLOC_FILL_SPACE enabled.
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #39
Norelius Wrote:As was previously mentioned, this will happen when you try to message a deallocated object. You have a pointer to the memory where your object used to be, but that memory is now occupied by (in this case) a different object of a different class.

Again, I highly recommend enabling zombies and seeing what happens. That will tell you the class of the deallocated object, its address, and who's trying to talk to it.

In case you don't know how to enable zombies:

1. Xcode "Project" Menu->Edit Active Executable
2. Select the arguments tab
3. In the "Variables to be set in the environment" list, add a new item whose name is "NSZombieEnabled" and whose value is "YES".

Also, it's highly unlikely that the over-release is occurring in system code. Don't fall back on that assumption until you've at least gone through the basic debugging steps, which include making use of the NSZombieEnabled, CFZombieLevel, MallocPreScribble, MallocScribble, and MallocGuardEdges environment variables, as well as inserting the libgmalloc library with MALLOC_FILL_SPACE enabled.

Wow. Don't suppose you could give me some hints as to why my buttons are causing memory leaks and why Core Animation and Graphics Services of all things are causing leaks? And why I can go through 2-3 iterations in my app before it crashes from a memory overflow?

[EDIT]
With your explanation, I'm pretty sure why I keep getting those unrecognized selectors: it's probably like you said, something else is occupying the memory block that I'm expecting to hold the object I want. Thanks! That helps in understanding the issue!...Now just how to solve it...?

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2006.10
Post: #40
Quote: Wow. Don't suppose you could give me some hints as to why my buttons are causing memory leaks and why Core Animation and Graphics Services of all things are causing leaks? And why I can go through 2-3 iterations in my app before it crashes from a memory overflow?
Smile I was only attempting to address your "Object Does Not Recognize selector" question.

Do other iPhone apps with similar UI components crash after 2-3 iterations? If not, it's probably not system code. Don't take it personally, everyone writes code with leaks - it's just that system code has probably been more thoroughly tested than your own Wink

The 'leaks' command line utility is incredibly useful if you enable the MallocStackLogging environment variable in your app. You could also try Instruments or OmniObjectMeter. Any of these will show you where the leaks are occurring, but I don't know if any of them are available to you when running your app.

Quote: Now just how to solve it...?
This is what my previous post was all about. Isn't it possible to use the Xcode debugger on your running app?
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #41
Norelius Wrote:Smile I was only attempting to address your "Object Does Not Recognize selector" question.

Do other iPhone apps with similar UI components crash after 2-3 iterations? If not, it's probably not system code. Don't take it personally, everyone writes code with leaks - it's just that system code has probably been more thoroughly tested than your own Wink

The 'leaks' command line utility is incredibly useful if you enable the MallocStackLogging environment variable in your app. You could also try Instruments or OmniObjectMeter. Any of these will show you where the leaks are occurring, but I don't know if any of them are available to you when running your app.


This is what my previous post was all about. Isn't it possible to use the Xcode debugger on your running app?

Correct. I am not saying that my code is flawless and it's system code that is generating the leaks, but Instruments points to buttons for a ViewController that I had moved aside using a navigation controller. As soon as I push the new viewController onto the NavController, Instruments begins pinging CALayer and GSEvent as leaks, and when I go down the stack log for those items, they lead back to my RoundedRect buttons on my first viewController. Instruments gives me addresses to these items, but that has proven to be less useful to me. I need to know WHICH ITEMS SPECIFICALLY they are so I can set up some release statements to make sure to get rid of them as fast as possible. I'm not sure if this can be done through a stack trace in the debugger, because it never displays memory, only process threads.


Please help!!!!

Also, I can't figure out if a ViewController that has been popped from a NavigationController is released or not. Everything I have done up to this points to no, but it makes you wonder if that could be a potential memory leak issue...

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #42
At this point, you may want to start commenting out large blocks of code until the problem disappears, comment parts back in one at a time, and zero in on the problem that way. Sometimes that's the only debugging technique that gets you anywhere.
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #43
Alright. All instruments tell me is there are something like 9 leaks in Symbol named "0x0" and it continues to show leaks for buttons, specifically their "calloc" calls. I have no idea where to go from here.

[EDIT]
Is it at all possible that exposing all of my objects in @property and @synthesize could be causing these leaks?

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #44
I would ignore the leaks until you've fixed the short-term crashes...
Quote this message in a reply
Member
Posts: 215
Joined: 2008.06
Post: #45
OneSadCookie Wrote:I would ignore the leaks until you've fixed the short-term crashes...

I think the memory leaks are the reason for the crashes. I'm beginning to believe that exit code 101 is a memory overflow error.

Mac users swear by their computers, PC users swear at their computers. ~Unknown

iSayz
Quote this message in a reply
Post Reply