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 08-16-2010, 04:11 PM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: Alaska
Posts: 63
mriphoneman is on a distinguished road
Default App crashing on UIButton setImage

Hey guys. I've got a weird bug in my app. The app is LED Flashlight (LED Flashlight - Brightest Flashlight for iPhone 4 for iPhone 4 on the iTunes App Store)

When you turn the LED light on, it will sometimes crash when I'm setting the image of a UIButton.

Here's the crash report:
Code:
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib               	0x3212e86c objc_msgSend + 16
1   libobjc.A.dylib               	0x3212fbe6 objc_setProperty
2   UIKit                         	0x32339a00 -[UIButtonContent setImage:]
3   UIKit                         	0x323626e4 -[UIButton setImage:forState:]
4   LED Flashlight                	0x00002826 -[LED_FlashlightViewController turnon] + 358
5   CoreFoundation                	0x303077a6 -[NSObject(NSObject) performSelector:withObject:withObject:]
6   UIKit                         	0x32383822 -[UIApplication sendAction:to:from:forEvent:]
7   UIKit                         	0x323837c2 -[UIApplication sendAction:toTarget:fromSender:forEvent:]
8   UIKit                         	0x32383794 -[UIControl sendAction:to:forEvent:]
9   UIKit                         	0x323834e6 -[UIControl(Internal) _sendActionsForEvents:withEvent:]
10  UIKit                         	0x32383b34 -[UIControl touchesEnded:withEvent:]
11  UIKit                         	0x323824e6 -[UIWindow _sendTouchesForEvent:]
12  UIKit                         	0x32381e60 -[UIWindow sendEvent:]
13  UIKit                         	0x3237db54 -[UIApplication sendEvent:]
14  UIKit                         	0x3237d500 _UIApplicationHandleEvent
15  GraphicsServices              	0x31a78140 PurpleEventCallback
16  CoreFoundation                	0x30352aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
17  CoreFoundation                	0x30354848 __CFRunLoopDoSource1
18  CoreFoundation                	0x30355626 __CFRunLoopRun
19  CoreFoundation                	0x302fe8e4 CFRunLoopRunSpecific
20  CoreFoundation                	0x302fe7ec CFRunLoopRunInMode
21  GraphicsServices              	0x31a776e8 GSEventRunModal
22  GraphicsServices              	0x31a77794 GSEventRun
23  UIKit                         	0x323272a0 -[UIApplication _run]
24  UIKit                         	0x32325e10 UIApplicationMain
25  LED Flashlight                	0x000020e4 main + 36
26  LED Flashlight                	0x000020b4 start + 32
Does anyone know what's going on? I've only had this happen to me a couple times, but it's coming in on the iTunes connect crash reports.

Any help is greatly appreciated.

Thanks!
mriphoneman is offline   Reply With Quote
Old 08-16-2010, 04:49 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

An EXEC_BAD_ACCESS is usually indicative of you not retaining an object when you should be. Go through your app and be sure that you're retaining things when you should be ( and releasing things when you should be.)
smithdale87 is offline   Reply With Quote
Old 08-16-2010, 05:23 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 mriphoneman View Post
Hey guys. I've got a weird bug in my app. The app is LED Flashlight (LED Flashlight - Brightest Flashlight for iPhone 4 for iPhone 4 on the iTunes App Store)

When you turn the LED light on, it will sometimes crash when I'm setting the image of a UIButton.

Here's the crash report:
Code:
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib               	0x3212e86c objc_msgSend + 16
1   libobjc.A.dylib               	0x3212fbe6 objc_setProperty
2   UIKit                         	0x32339a00 -[UIButtonContent setImage:]
3   UIKit                         	0x323626e4 -[UIButton setImage:forState:]
4   LED Flashlight                	0x00002826 -[LED_FlashlightViewController turnon] + 358
5   CoreFoundation                	0x303077a6 -[NSObject(NSObject) performSelector:withObject:withObject:]
6   UIKit                         	0x32383822 -[UIApplication sendAction:to:from:forEvent:]
7   UIKit                         	0x323837c2 -[UIApplication sendAction:toTarget:fromSender:forEvent:]
8   UIKit                         	0x32383794 -[UIControl sendAction:to:forEvent:]
9   UIKit                         	0x323834e6 -[UIControl(Internal) _sendActionsForEvents:withEvent:]
10  UIKit                         	0x32383b34 -[UIControl touchesEnded:withEvent:]
11  UIKit                         	0x323824e6 -[UIWindow _sendTouchesForEvent:]
12  UIKit                         	0x32381e60 -[UIWindow sendEvent:]
13  UIKit                         	0x3237db54 -[UIApplication sendEvent:]
14  UIKit                         	0x3237d500 _UIApplicationHandleEvent
15  GraphicsServices              	0x31a78140 PurpleEventCallback
16  CoreFoundation                	0x30352aa4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
17  CoreFoundation                	0x30354848 __CFRunLoopDoSource1
18  CoreFoundation                	0x30355626 __CFRunLoopRun
19  CoreFoundation                	0x302fe8e4 CFRunLoopRunSpecific
20  CoreFoundation                	0x302fe7ec CFRunLoopRunInMode
21  GraphicsServices              	0x31a776e8 GSEventRunModal
22  GraphicsServices              	0x31a77794 GSEventRun
23  UIKit                         	0x323272a0 -[UIApplication _run]
24  UIKit                         	0x32325e10 UIApplicationMain
25  LED Flashlight                	0x000020e4 main + 36
26  LED Flashlight                	0x000020b4 start + 32
Does anyone know what's going on? I've only had this happen to me a couple times, but it's coming in on the iTunes connect crash reports.

Any help is greatly appreciated.

Thanks!
I agree with smithdale87. That error usually means you have tried to send a message to an object that was released.

You might try using the "zombies" instrument, or clean your project and select "build and analyze" from the build menu. The static analyzer is pretty good at finding memory management problems with your code. If you haven't run it before, it may find a whole bunch of possible issues. It's usually worth fixing them all.
__________________
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 08-16-2010, 07:11 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,050
wuf810 is on a distinguished road
Default

Quote:
Originally Posted by mriphoneman View Post
Hey guys. I've got a weird bug in my app. The app is LED Flashlight (LED Flashlight - Brightest Flashlight for iPhone 4 for iPhone 4 on the iTunes App Store)

When you turn the LED light on, it will sometimes crash when I'm setting the image of a UIButton.

Does anyone know what's going on? I've only had this happen to me a couple times, but it's coming in on the iTunes connect crash reports.

Any help is greatly appreciated.

Thanks!
As the other's have pointed out you are trying to access an already released object.

BTW What makes your App's Flashlight the "brightest" - I don't believe there is anyway to change the intensity of the LED is there? Would it not be fairer to say the following:

"LED Flashlight - Same Brightness as other Flashlight apps for iPhone 4"
wuf810 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: 354
4 members and 350 guests
givensur, linkmx, Newbie123, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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