jorgenpt/ObjectiveMetrics — Issue #18: Crashes when initialize defaultTracker
Author: bernardomporto
Created: 2011-11-03 12:50:04+00:00
State: open

I download the latest Objective-C library (as of a few minutes ago), built it, and linked it into my app. But now it crashes when I initialize the defaultTracker (even before I track any events).

My code looks like this in applicationDidFinishLaunching:

#ifdef DESKMETRICS
// Initialize remote event tracking.
NSLog(@"Starting DeskMetrics...");

NSDate *start = [NSDate date];
self.tracker = [DMTracker defaultTracker];
[self.tracker startApp];
NSTimeInterval elapsedTime = -[start timeIntervalSinceNow];

NSLog(@"Started DeskMetrics [%.3f sec]", elapsedTime);

// TODO: Remove this once DeskMetrics is working.
[self.tracker trackLog:@"Tracker started"];
#endif

011-10-28 19:02:11.861 Box[2998:903] Starting DeskMetrics...
2011-10-28 19:02:11.862 Box[2998:903] -[DMRequester init], line 51: URL: https://4ea4801aa14ad70de3000000.api.deskmetrics.com/sendData
2011-10-28 19:02:11.866 Box[2998:903] -[DMRequester send:], line 97: Sending data: [{"tp":"ev","ts":1319497093,"fl":"19","nm":"get_updates","ss":"2C164720-56AC-43EB-9CAD-D0474AEFBC73","ca":"Box API call"},{"tp":"ev","ts":1319497153,"fl":"20","nm":"get_updates","ss":"2C164720-56AC-43EB-9CAD-D0474AEFBC73","ca":"Box API call"},{"ss":"2C164720-56AC-43EB-9CAD-D0474AEFBC73","ts":1319497154},{"ss":"2C164720-56AC-43EB-9CAD-D0474AEFBC73","ts":1319497155}]
(gdb) bt
#0 0x00007fff83477530 in CFSetApplyFunction ()
#1 0x00007fff82f73e1c in RunLoopMultiplexer::sourceForScheduling ()
#2 0x00007fff82f73d98 in RunLoopMultiplexer::schedule ()
#3 0x00007fff82f73d03 in URLConnectionClient::start ()
#4 0x0000000100086cc8 in -[DMRequester send:] (self=0x1001bf7a0, _cmd=0x7fff85ae9548, events=0x1001c4710) at /Users/mself/src/jorgenpt-ObjectiveMetrics-d7c8bb7/ObjectiveMetrics/DMRequester.m:146
#5 0x000000010007e707 in -[DMTrackingQueue sendEvents:] (self=0x1001bf080, _cmd=0x10008aeac, sentEvents=0x1001c4710) at /Users/mself/src/jorgenpt-ObjectiveMetrics-d7c8bb7/ObjectiveMetrics/DMTrackingQueue.m:104
#6 0x000000010007e9d3 in -[DMTrackingQueue flush] (self=0x1001bf080, _cmd=0x7fff84caf082) at /Users/mself/src/jorgenpt-ObjectiveMetrics-d7c8bb7/ObjectiveMetrics/DMTrackingQueue.m:125
#7 0x000000010007bfbf in -[DMTracker init] (self=0x1001becd0, _cmd=0x7fff84c9aac8) at /Users/mself/src/jorgenpt-ObjectiveMetrics-d7c8bb7/ObjectiveMetrics/DMTracker.m:141
#8 0x000000010007bab2 in +[DMTracker defaultTracker] (self=0x100090be8, _cmd=0x7fff83802e8f) at /Users/mself/src/jorgenpt-ObjectiveMetrics-d7c8bb7/ObjectiveMetrics/DMTracker.m:101
#9 0x0000000100001f3b in -[BFSAppDelegate applicationDidFinishLaunching:] (self=0x1005271d0, _cmd=0x7fff88df2f07, notification=0x10056c830) at /Users/mself/src/platform/apple/macos/BoxFS/Sources/BFSAppDelegate.m:230
#10 0x00007fff85ee2bc5 in _nsnote_callback ()
#11 0x00007fff83499000 in __CFXNotificationPost ()
#12 0x00007fff83485578 in _CFXNotificationPostNotification ()
#13 0x00007fff85ed9b26 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
#14 0x00007fff845d644a in -[NSApplication _postDidFinishNotification] ()
#15 0x00007fff845d637f in -[NSApplication _sendFinishLaunchingNotification] ()
#16 0x00007fff846a135d in -[NSApplication(NSAppleEventHandling) _handleAEOpen:] ()
#17 0x00007fff846a0fd9 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] ()
#18 0x00007fff85f111c6 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
#19 0x00007fff85f10ff6 in _NSAppleEventManagerGenericHandler ()
#20 0x00007fff83b2c32b in aeDispatchAppleEvent ()
#21 0x00007fff83b2c224 in dispatchEventAndSendReply ()
#22 0x00007fff83b2c12b in aeProcessAppleEvent ()
#23 0x00007fff80037619 in AEProcessAppleEvent ()
#24 0x00007fff845a6095 in _DPSNextEvent ()
#25 0x00007fff845a5801 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#26 0x00007fff8456b68f in -[NSApplication run] ()
#27 0x00007fff845643b0 in NSApplicationMain ()
#28 0x0000000100005812 in main (argc=1, argv=0x7fff5fbff738) at
(gdb)