Program received signal: "SIGKILL" when starting recording in Instruments - iphone

I would like to use Instruments to check for any memory leaks in my iPhone app.
But as soon as I'm pressing the record button in Instruments, the Xcode status bar is mentioning:
GDB: Program received signal: "SIGKILL".
My app is of course not responding anymore on my iPhone.
Does anyone know what the problem is?

Step 1 - Quit the Instruments, Xcode and Simulator.
Step 2 - Start Xcode.
Step 3 - Go to Run -> Run with performance tool -> Leaks.
Thats it!

Related

ARC lite enabled app crashes on 2nd gen iPod only in Release configuration

I have an ARC lite enabled app (ARC enabled without zeroing weak reference, Apple LLVM 4.0). Deployment target set to iOS 4.0. It's been tested on iOS 4.0 to 5.1.1. It always works fine when I use debug build and install through Xcode, but when I create an adhoc build with release configuration, it always crash during launch on 2nd gen iPod with iOS 4.2.1, but works fine on other devices (even 3rd gen iPod with iOS 4.3).
The crash log says
symbol not found: _objc_retainAutoreleasedReturnValue
and it crashes when method main is called (then it's dyld_stub_binder, dyld::fastBindLazySymbol)
I did some search and this crash normally happens when an arc enabled library is included in a project without arc. But in my case arc is enabled for the whole project.
Any clues?
Thanks very much.
[EDIT] Update: I can use NSLog to debug the adhoc build.
The main.m is like:
int main(int argc, char *argv[]) {
NSLog(#"ok before entering autorelease pool");
#autoreleasepool {
NSLog(#"ok after entering autorelease pool");
return UIApplicationMain(argc, argv, nil, NSStringFromClass([XXX class]));
}
}
NSLog(#"ok after entering autorelease pool") gets called successfully, but application:didFinishLaunchingWithOptions: is never entered.
It seems that it's related to the command line build tool. I used to use xcodebuild command to archive the adhoc build:
xcodebuild -scheme myscheme clean build archive
And got this crash.
Then I tried archiving from Xcode, the adhoc build actually works fine on all devices. So weird (keep in mind that the command line built adhoc worked for devices newer than iPod 2nd gen).
For now I'll just use the Archive button in Xcode. But I posted this question in Apple dev forum:
https://devforums.apple.com/message/711334
My answer: How i come out from the same problem.
Steps:
1.First make the all the changes in the code sign column and make sure that all the setting are work same as you want in the project tab and target tab as well.
2.Just making all the setting in the first step like selecvting correct provsioning and specify accurate bundle indetifier then now make the xcode quit .
3.After 2 step just restart you computer and then make build for the profile that you selected in first step.
Now its working fine ,hope so this answer may be help you as well.Anyway its my solution of the above problem.....:)

Paypal iphone integration error

[PayPal initializeWithAppID:#"APP-80W284485P519543T" forEnvironment:ENV_SANDBOX];
UIButton *button = [[PayPal getInstance] getPayButtonWithTarget:self andAction:#selector(payWithPayPal) andButtonType:BUTTON_278x43];
Any one of line, If I am writting in my application's viewDidLoad or appDidFinishLauch, then it works fine on simulator, but while I do run it on iOS5 (iPod Touch) it gives the following error, and goes hang or crash...
Program received signal: “EXC_BAD_ACCESS”.
warning: check_safe_call: could not restore current frame
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Can't find dlopen function, so it is not possible to load shared libraries.)
What is meaning of this issue, and how to solve it?
NOTE: The issue is only in iOS5, in all other devices and simulators, its working fine,
I am using Mac OS 10.6 and SDK is 4.
Can anyone has issue like this, or know how to solve it?

how to gather Instruments memory/zombies data after removing & restarting app in the simulator?

How can I gather Instruments memory/zombies data after removing app in simulator and restarting in simulator?
What I see in the simulator after I remove the app process, and then retart it by clicking on it's icon in the simulator, is that Instruments has stopped receiving the data from the application?
Background
I'm trying to test saving and loading data via NSUserDefaults. After saving it to test the loading part I need to simulate removing the app from memory, so what I have been doing is manually removing the app process on the simulator (double click on menu button etc).
What I'm finding is that when I do run up the app this way there is some problem at start up - getting "Thread 1 - Program received signal SIGKILL" against the " int retVal = UIApplicationMain(argc, argv, nil, nil);" line of code
Therefore I thought I would try to run in Instruments to track down the issue, hence my question as Instruments seems to "stop recording" after I kill the app process on the simulator and then restart.
Not possible (i.e. no answers yet so I'm guessing the correct answer may be that it's not possible)

Audio will play in 3.2 sim but not in 4.x

This streaming audio app will play in 3.2 simulator, but not in 4.x sim or my 4.1 iPhone.
The console logs are as follows:
4.0 Sim
This GDB was configured as "x86_64-apple-darwin".Attaching to process 13237.
[Switching to process 13237]
2010-11-15 19:54:49.606 Issues[13237:1c07] AddRunningClient starting device on non-zero client count
2010-11-15 19:55:16.220 Issues[13237:6307] AQMEIO_Base::DoStartIO: timeout
2010-11-15 19:55:16.498 Issues[13237:6307] AQMEDevice::StartIO: error -66681
2010-11-15 19:55:16.499 Issues[13237:6307] CA_UISoundClientBase::StartPlaying: AddRunningClient failed (status = -66681).
2010-11-15 19:55:46.499 Issues[13237:1c07] AQMEIO_Base::DoStartIO: timeout
2010-11-15 19:55:46.777 Issues[13237:1c07] AQMEDevice::StartIO: error -66681
2010-11-15 19:55:46.778 Issues[13237:1c07] Audio queue start failed. err: ˇ˛˚á -66681
[Switching to process 13237]
4.1 Device
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys001
target remote-mobile /tmp/.XcodeGDBRemote-11399-40
Switching to remote-macosx protocol
mem 0x1000 0x3fffffff cache
mem 0x40000000 0xffffffff none
mem 0x00000000 0x0fff none
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
[Switching to thread 13059]
[Switching to thread 11523]
If it makes you feel better, I have had this exact problem for a couple weeks with no solution in sight. I think it occurred when I upgraded my ipad to 4.2 but I am not sure. I was still able to use the 3.2 simulator for my music app testing, but now I have been making my app universal and there is no way to test the iphone code on the simulator.
EDIT: I fixed it!!
The only other google search result for this error led me to poke around in my audio settings. I have a Blackmagic Intensity Pro HDMI capture card and it was set as my audio input device. I changed it to "Line in" or whatever, restarted my Mac, and then the simulator worked again!
I was also messing around with my audio output settings, so it's hard to know for sure what actually solved it, but the key is: mess around with your audio settings, restart your Mac and cross your fingers.
one more edit: I had this same problem occur with a webcam on my other, work computer. I changed the audio from the input of the web cam back to line in, and it worked again. How are more people not seeing this?
I had this problem, and fixed it by unplugging an external microphone which was hooked up via USB. Not sure why this fixed it, but it did.
I have the problem too, but i fixed it in some minutes, thank to Ethical. Although the problem is same, my code is different, my code supplie in the video player. My code run good in the ipad/iphone device, but not in simulator. When the video start playing, the simulator freezon, the output is like you, but i remember i plug in the earphone just now, and pull out some miniutes later, so the setting of audio player changed, i think. So, i plug in the earphone again and restart my mac. The problem solved. So just restart your mac, or check the setting of audio player.
+1 .... Checking and changing the Mac's audio input also worked for me. I had no sound in the simulator (Mac Pro) but my app worked fine on the device (iPad 3) calling
[[SimpleAudioEngine sharedEngine] playEffect:#"soundname.caf"];
In the sim, there was a long lag after first trying to play a sound (my app seemed to hang, with high CPU usage). After a long time it would give a AQMEIO_Base::DoStartIO: timeout error and the app would resume, albeit without sound. Happened every time I ran it.
The sound output was shown as line out, but sound input was set to digital. Changing the input to line in made sound work in the simulator.
There is still a cascade of warnings in the sim on startup, starting with:
Error loading
/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:
dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,
262): Symbol not found: ___CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
and ending in
Default audio device changed. Restart the simulator to have it use the newly-selected device.
But sound now works and I can test the app using the simulator.
Try to play your audio on MPMovidePlayerController instead of MPMediaPlayer

IOS 4 behavior exit application

I have a hard time to understand my iPhone Application strange behavior in iOS4.
Exit my app with Home button -> applicationWillResignActive , didEnterBackground is called,
Open my app -> applicationDidBecomeActive , didEnterForground is called. Everything is normal here.
Exit my app with Home button -> applicationWillResignActive , didEnterBackground is called,
Double tap Home button, exit my app with "minus" button.
Open my app -> applicationDidBecomeActive , didEnterForground is called.
Exit my app with Home button -> applicationWillTerminate is called.
Debugger stopped.
Program exited with status value:0.
(4, 5 , 6) . What is really happening when I press minus button? Shouldn't application terminate and next time I open application (BOOL)application:(UIApplication*)application didFinishLaunching be called?
Can anyone help me understand this?
If the application have already entered the inactive state (applicationWillResignActive+didEnterBackground) you will not get any further notifications if the application is terminated.
I would though expect your application to stop completely after step 4, but since you didn't get the debugger terminated message (as in step 7) somehow the application didn't terminate fully.
The WWDC 2010 Session 105 - Adopting Multitasking on iPhone OS, Part 1 Video explains the application state transitions extremely well.
Also see iOS Debugging Magic (Technical Note TN2239) and Understanding and Analyzing iPhone OS Application Crash Reports (Technical Note TN2151).
Jeff