Flurry Analytics crashes application after second start - objective-c

we use flurry (advertisement and analytics) in our application. Since some time the application simple crashes after it was used on this phone and we start it again.
The complete error log:
Flurry: Starting session on Agent Version [Flurry_iOS_123_4.3.2]
2014-04-29 12:48:24.875 <ProjectName> 2.0[62373:1303] -[NSNull length]: unrecognized selector sent to instance 0x5a8068
2014-04-29 12:48:24.879 <ProjectName> 2.0[62373:1303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull length]: unrecognized selector sent to instance 0x5a8068'
*** First throw call stack:
(
0 CoreFoundation 0x0045c1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02e748e5 objc_exception_throw + 44
2 CoreFoundation 0x004f9243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0044c50b ___forwarding___ + 1019
4 CoreFoundation 0x0044c0ee _CF_forwarding_prep_0 + 14
5 <ProjectName> 2.0 0x00128722 +[FlurryProtocolData limitStringLength:] + 35
6 <ProjectName> 2.0 0x001289ae +[FlurryProtocolData appendString:toData:] + 46
7 <ProjectName> 2.0 0x0012d1f2 -[FlurrySession data] + 1398
8 <ProjectName> 2.0 0x0012c3a7 +[FlurrySession addToSavedSessions:] + 148
9 <ProjectName> 2.0 0x00128e65 +[FlurrySession sessionWithApiKey:startTime:] + 472
10 <ProjectName> 2.0 0x00139fc4 __29-[FlurryImpl setupForApiKey:]_block_invoke + 291
11 libdispatch.dylib 0x03a1d7b8 _dispatch_call_block_and_release + 15
12 libdispatch.dylib 0x03a324d0 _dispatch_client_callout + 14
13 libdispatch.dylib 0x03a20047 _dispatch_queue_drain + 452
14 libdispatch.dylib 0x03a1fe42 _dispatch_queue_invoke + 128
15 libdispatch.dylib 0x03a20de2 _dispatch_root_queue_drain + 78
16 libdispatch.dylib 0x03a21127 _dispatch_worker_thread2 + 39
17 libsystem_pthread.dylib 0x03d61dab _pthread_wqthread + 336
18 libsystem_pthread.dylib 0x03d65cce start_wqthread + 30
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
(username, project name and other privacy related parts have been replaced)
My code:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
...
[Flurry startSession:#"<API-CODE>"];
...
return YES;
}
Edit 1:
I checked that the variable with the API-Key is really set and removed it even with a fixed value and I still get the same problem. Commenting the line of Flurry fixes the crash.
Edit 2:
The problem only appears after I already tracked some events with Flurry. So if I kill the application then and restart it, I get this error message. If I uninstall the application and reinstall it later, the error has gone. So it seems to be something within the saved state of Flurry.

It actually was because I transmitted an integer as user-id to flurry. But they only support strings for that. So please change your parameters accordingly.

Related

Appcelerator - iOS - KrollObject forgetKeylessKrollObject

Recently we have received a crash on one of our application with the following stack trace:
0 libobjc.A.dylib 0x00000001806c1bd0 objc_msgSend + 12
1 CoreFoundation 0x0000000180f72d90 -[NSInvocation retainArguments] + 208
2 Foundation 0x00000001819e86b4 -[NSInvocationOperation initWithInvocation:] + 72
3 Foundation 0x00000001819e85c8 -[NSInvocationOperation initWithTarget:selector:object:] + 216
4 MyApp 0x0000000100054500 -[KrollObject forgetKeylessKrollObject:] (KrollObject.m:1079)
5 MyApp 0x00000001000a1cac -[TiProxy forgetProxy:] (TiProxy.m:725)
6 MyApp 0x000000010005b070 -[TiViewProxy remove:] (TiViewProxy.m:261)
7 MyApp 0x00000001000ba294 __TiThreadPerformOnMainThread_block_invoke (TiBase.m:270)
8 MyApp 0x00000001000ba570 TiThreadProcessPendingMainThreadBlocks (TiBase.m:367)
9 libdispatch.dylib 0x0000000180a95630 _dispatch_call_block_and_release + 20
10 libdispatch.dylib 0x0000000180a955f0 _dispatch_client_callout + 12
11 libdispatch.dylib 0x0000000180a9acf8 _dispatch_main_queue_callback_4CF + 1840
12 CoreFoundation 0x0000000180ff8bb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
13 CoreFoundation 0x0000000180ff6a18 __CFRunLoopRun + 1624
14 CoreFoundation 0x0000000180f25680 CFRunLoopRunSpecific + 380
15 GraphicsServices 0x0000000182434088 GSEventRunModal + 176
16 UIKit 0x0000000185d9cd90 UIApplicationMain + 200
17 MyApp 0x000000010003c584 main (main.m:37)
Dashboard suggests that the crash has happened at forgetKeylessKrollObjject method. From the stack trace it seems that during a view removal, this indicent happened. There are many places in the code where we have added and removed view. As there is no definite place defined in the log and nor we have the test case, we went through the framework code and saw that there is no null handling inside the method as TiProxy.m --> krollObjectForBridge function can return nil.
If anyone from the community has received such report and been able to resolve it. Please do let us know as there is no way to map this stack trace back to the JavaScript code.
SDK: 3.5.0.GA
OS: iOS 9.1

Understanding XCode debug area error messages

For example, I get this error in debug area:
2014-05-01 05:01:28.052 MyApp[93187:303] *** setObjectForKey: object cannot be nil (key: -1)
2014-05-01 05:01:28.057 MyApp[93187:303] (
0 CoreFoundation 0x00007fff8cb3f25c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff89202e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff8ca3a46e -[__NSDictionaryM setObject:forKey:] + 1102
3 MyApp 0x0000000100009725 +[SystemTools getData:] + 5509
4 MyApp 0x0000000100001c4b -[AppDelegate drawCanvas:] + 1467
5 MyApp 0x0000000100001675 -[AppDelegate repeatingTimer:] + 85
6 Foundation 0x00007fff8ec480f4 __NSFireTimer + 96
7 CoreFoundation 0x00007fff8caa6564 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
8 CoreFoundation 0x00007fff8caa609f __CFRunLoopDoTimer + 1151
9 CoreFoundation 0x00007fff8cb175aa __CFRunLoopDoTimers + 298
10 CoreFoundation 0x00007fff8ca618e5 __CFRunLoopRun + 1525
11 CoreFoundation 0x00007fff8ca610b5 CFRunLoopRunSpecific + 309
12 HIToolbox 0x00007fff875dca0d RunCurrentEventLoopInMode + 226
13 HIToolbox 0x00007fff875dc7b7 ReceiveNextEventCommon + 479
14 HIToolbox 0x00007fff875dc5bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
15 AppKit 0x00007fff907853de _DPSNextEvent + 1434
16 AppKit 0x00007fff90784a2b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
17 AppKit 0x00007fff90778b2c -[NSApplication run] + 553
18 AppKit 0x00007fff90763913 NSApplicationMain + 940
19 MyApp 0x0000000100016aa2 main + 34
20 libdyld.dylib 0x00007fff9440b5fd start + 1
21 ??? 0x0000000000000003 0x0 + 3
)
Unfortunately, I have saveral "setObject:forKey:" calls in "SystemTools getData:" function.
How can I determine to which call this error is related? What that numbers (after plus) means?
Add an Execption breakpoint in your break points. This will halt at the line of code which is causing the app to crash. That way you dont have to debug with NSLogs.
The default behavior of Xcode is to stop where the exception is
caught, not where the exception is raised!
To explain those lines in the crash logs:
From Ray Wenderlich's blog:
2 XYZLib 0x34648e88 0x83000 + 8740
It is basically four columns:
The frame number – in this case, 2.
The name of the binary – in this case, XYZLib.
The address of the function that was called – in this case, 0x34648e88.
The fourth column is divided into two sub-columns, a base address and an offset. Here it is 0×83000 + 8740, where the first number points to the file, and the second points to the line of code in that file.
Use breakpoints in all of your setObject:forKey calls. Use NSLog for print some useful information in log. You are a developer so you need to know debugging also.
The first line of the output is useful here:
setObjectForKey: object cannot be nil (key: -1)
The NSDictionary doesn't like nil values, so look for a place in your getData method that could be assigning a nil value to a key of "-1".
Good luck!

iphone application crash on replacing the video files

I only replace the video files in my existing code, but if i replace all the video files my application will crash in iphone. it is an universal application but Ipad support all the new video files and crash on iphone. the following warning occur:
[NSCFType setLength:]: unrecognized selector sent to instance
0x19d790 2012-02-29 15:13:49.932[584:307] * Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType
setLength:]: unrecognized selector sent to instance 0x19d790'
* Call stack at first throw: ( 0 CoreFoundation 0x3759dc7b __exceptionPreprocess + 114 1 libobjc.A.dylib
0x32d9bee8 objc_exception_throw + 40 2 CoreFoundation
0x3759f3e3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 98 3
CoreFoundation 0x37544467 __forwarding + 506
4 CoreFoundation 0x37544220
_CF_forwarding_prep_0 + 48 5 Visionaries 0x00005179 -[Visionaries_ViewController
connection:didReceiveResponse:] + 56 6 Foundation
0x35183cd5 -[NSURLConnection(NSURLConnectionReallyInternal)
sendDidReceiveResponse:] + 92 7 Foundation
0x35183c3b _NSURLConnectionDidReceiveResponse + 86 8 CFNetwork
0x302941b4
_ZN19URLConnectionClient29_clientSendDidReceiveResponseEP14_CFURLResponsePNS_26ClientConnectionEventQueueE
+ 64 9 CFNetwork 0x30284bc8 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl
+ 332 10 CFNetwork 0x30284d84 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl
+ 776 11 CFNetwork 0x30284984 _ZN19URLConnectionClient13processEventsEv + 100 12 CFNetwork 0x3028484c _ZN17MultiplexerSource7performEv + 192 13 CFNetwork
0x30284788 _ZN17MultiplexerSource8_performEPv + 12 14 CoreFoundation
0x375518d1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 14 15 CoreFoundation 0x37521ecd __CFRunLoopDoSources0 + 384 16 CoreFoundation 0x375216f9 __CFRunLoopRun + 264 17 CoreFoundation
0x3752150b CFRunLoopRunSpecific + 226 18 CoreFoundation
0x37521419 CFRunLoopRunInMode + 60 19 GraphicsServices
0x33e76d24 GSEventRunModal + 196 20 UIKit
0x3591d57c -[UIApplication _run] + 588 21 UIKit
0x3591a558 UIApplicationMain + 972 22 Visionaries
0x00002391 main + 80 23 Visionaries
0x0000233c start + 40 ) terminate called after throwing an instance of
'NSException'
Somebody has an idea, please help.
By the crash log we see that, inside -[Visionaries_ViewController connection:didReceiveResponse:], you are calling the method setLength: on an object that does not have that method.
Can be a memory or logic problem. Please provide more info.

objective-c : unable to understand the exception producer place from stack trace?

I am new to iphone developement, during development I face problem due to this error. I am unable to trace it that from where it is produced.
app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 5 beyond bounds [0 .. 4]'
*** Call stack at first throw:
(
0 CoreFoundation 0x012dcbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x014315c2 objc_exception_throw + 47
2 CoreFoundation 0x012d26e5 -[__NSArrayM objectAtIndex:] + 261
3 Dispatch 0x0002feeb -[ZoneFareTaxi parseMessage:] + 754
4 Dispatch 0x0002fbf0 -[ZoneFareTaxi initWithMessageString:] + 92
5 Dispatch 0x0003b949 -[ServerConnection onUdpSocket:didReceiveData:withTag:fromHost:port:] + 8862
6 Dispatch 0x0002350e -[AsyncUdpSocket maybeCompleteCurrentReceive] + 458
7 Dispatch 0x00023210 -[AsyncUdpSocket doReceive:] + 1364
8 Dispatch 0x00022c60 -[AsyncUdpSocket doReceive4] + 80
9 Dispatch 0x00022add -[AsyncUdpSocket maybeDequeueReceive] + 561
10 Foundation 0x000da7f6 __NSFireDelayedPerform + 441
11 CoreFoundation 0x012bdfe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
12 CoreFoundation 0x012bf594 __CFRunLoopDoTimer + 1220
13 CoreFoundation 0x0121bcc9 __CFRunLoopRun + 1817
14 CoreFoundation 0x0121b240 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x0121b161 CFRunLoopRunInMode + 97
16 GraphicsServices 0x01a4d268 GSEventRunModal + 217
17 GraphicsServices 0x01a4d32d GSEventRun + 115
18 UIKit 0x0036a42e UIApplicationMain + 1160
19 Dispatch 0x000024b4 main + 102
20 Dispatch 0x00002445 start + 53
21 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
This is likely an off by one error. Your NSMutableArray has only 5 elements and you are accessing the 6th object at index 5. Indexes are 0 based.
The problem resides likely in this method: [ZoneFareTaxi parseMessage:]
It should be in the parseMessage method implementation, of the class ZoneFareTaxi.
In that method you send the message objectAtIndex: to an NSMutableArray object, passing a value that in that case is 5 (presumably using a variable).
It says that you are accessing to the sixth element of the array, while it has only 5 elements. Arrays are 0 indexed.
this problem only appears only if your trying to access an element from array with index is greater than your count of array.
From this:
-[NSMutableArray objectAtIndex:]: index 5 beyond bounds [0 .. 4]
you can see that you're trying to access index 5 in an array that only goes from 0 to 4.
From this:
objc_exception_throw + 47
-[__NSArrayM objectAtIndex:] + 261
-[ZoneFareTaxi parseMessage:] + 754
you can see that the problem is happening in your [ZoneFareTaxi parseMessage:] method.

Debugging an iPad device crash with little info

I'm getting the following stack trace from an iPad crash pulled from the device. This was pulled from a user's iPad and I don't know what they were doing when it crashed. How would I get more info on why/where the app is crashing and fix it?
Uncaught C++ Exception
Stack trace:
0 - 0 MyApp 0x00005ac1 _Z16TerminateHandlerv + 24
1 - 1 libstdc++.6.dylib 0x33814e3d _ZN10__cxxabiv111__terminateEPFvvE + 52
2 - 2 libstdc++.6.dylib 0x33814e91 _ZSt9terminatev + 16
3 - 3 libstdc++.6.dylib 0x33814f61 __cxa_throw + 84
4 - 4 libobjc.A.dylib 0x3441dc8b objc_exception_throw + 70
5 - 5 Foundation 0x3645192b __NSThreadPerformPerform + 654
6 - 6 CoreFoundation 0x34e16a79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
7 - 7 CoreFoundation 0x34e1875f __CFRunLoopDoSources0 + 382
8 - 8 CoreFoundation 0x34e194eb __CFRunLoopRun + 230
9 - 9 CoreFoundation 0x34da9ec3 CFRunLoopRunSpecific + 230
10 - 10 CoreFoundation 0x34da9dcb CFRunLoopRunInMode + 58
11 - 11 GraphicsServices 0x339d041f GSEventRunModal + 114
12 - 12 GraphicsServices 0x339d04cb GSEventRun + 62
13 - 13 UIKit 0x33a07d69 -[UIApplication _run] + 404
14 - 14 UIKit 0x33a05807 UIApplicationMain + 670
15 - 15 MyApp 0x000036af main + 70
16 - 16 MyApp 0x00003664 start + 40
Two things you might try:
Somtimes apps crash and the debugger stops on a completely different method. Enable "guard malloc" in the xcode run settings (under schemes in xcode4), run the app in the debugger utill it crashes, and see if that shows you which method is to blame.
If not, your best bet is to run the app in the debugger and make the crash happen. Try everything, simulate memory warnings everywhere, use every feature of the app, try every possible combination of paths through the app. Asking the user what they think they were doing might narrow it down some.