Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-24-2010, 02:49 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 42
frankmail007 is on a distinguished road
Default Strange EXC_BAD_ACCESS problem

My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.

I know it must be something wrong in memory management. But how can I debug the problem?

Last edited by frankmail007; 10-24-2010 at 02:55 AM.
frankmail007 is offline   Reply With Quote
Old 10-24-2010, 04:24 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Quote:
Originally Posted by frankmail007 View Post
My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.

I know it must be something wrong in memory management. But how can I debug the problem?
reading a book. or posting the code.
__________________
dany_dev is offline   Reply With Quote
Old 10-24-2010, 06:22 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by frankmail007 View Post
My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.

I know it must be something wrong in memory management. But how can I debug the problem?
Make sure you are using a debug build of your app, and run it in XCode using the "Build and debug" menu option (command Y)

EXEC_BAD_ACCESS is almost always an over-released object, so zombies is the right tool to find it.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 10-24-2010, 07:42 PM   #4 (permalink)
Registered Member
 
god0fgod's Avatar
 
Join Date: Jul 2010
Posts: 278
god0fgod is on a distinguished road
Default

Also check the stack to learn where the error was made. That can help.
__________________
god0fgod is offline   Reply With Quote
Old 10-24-2010, 07:55 PM   #5 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by god0fgod View Post
Also check the stack to learn where the error was made. That can help.

Unfortunately, with over-released objects the stack track is not usually useful. By the time the crash occurs, the source of the over-release is usually long gone.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 10-24-2010, 07:59 PM   #6 (permalink)
Registered Member
 
god0fgod's Avatar
 
Join Date: Jul 2010
Posts: 278
god0fgod is on a distinguished road
Default

It's worth a look, if it doesn't take you to the problem straight away it gives you vital clues and you can trace the problem back to the source.
__________________
god0fgod is offline   Reply With Quote
Old 10-26-2010, 05:11 AM   #7 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 42
frankmail007 is on a distinguished road
Default

The problem is there is nothing in stacks and console although I'm running the program in debug and NSZombieEnabled is set to YES.

But anyway, I solved the problem. I accidentally put [super alloc] before other object's release.

Thank you all anyway.
frankmail007 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 322
12 members and 310 guests
chiataytuday, condor304, Desert Diva, Domele, dre, dreamdash3, mottdog, oceanlablight, palme2elie, Paul Slocum, schmallegory
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,659
Threads: 94,118
Posts: 402,895
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dreamdash3
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:15 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0