0

I have an iOS customer reporting a consistent, crashing bug, with the following stack:

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00d
Triggered by Thread:  0

Filtered syslog:
None found


Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000018eb741a8 semaphore_wait_trap + 8
1   libdispatch.dylib               0x000000018ea5f7ec _dispatch_semaphore_wait_slow + 216
2   Scruff                          0x00000001003bf0fc -[TMCache setObject:forKey:] (TMCache.m:332)
3   Scruff                          0x00000001000c2a40 __44-[MSSProfileStreamingDataSource downloaded:]_block_invoke (MSSProfileStreamingDataSource.m:532)
4   libdispatch.dylib               0x000000018ea4d200 _dispatch_call_block_and_release + 24
5   libdispatch.dylib               0x000000018ea4d1c0 _dispatch_client_callout + 16
6   libdispatch.dylib               0x000000018ea51d6c _dispatch_main_queue_callback_4CF + 1000
7   CoreFoundation                  0x000000018fb71f2c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
8   CoreFoundation                  0x000000018fb6fb18 __CFRunLoopRun + 1660
9   CoreFoundation                  0x000000018fa9e048 CFRunLoopRunSpecific + 444
10  GraphicsServices                0x0000000191521198 GSEventRunModal + 180
11  UIKit                           0x0000000195a77818 -[UIApplication _run] + 684
12  UIKit                           0x0000000195a72550 UIApplicationMain + 208
13  Scruff                          0x00000001000cc9b8 main (main.m:22)
14  libdyld.dylib                   0x000000018ea805b8 start + 4

Can someone explain exactly what semaphore_wait_trap is doing, and in what conditions it would trigger an EXEC_CRASH? SIGKILL means someone else triggered a kill - does this mean that iOS is killing the app because the semaphore wait took too long?

Here is the code in question for TMCache, which is the Tumblr cache library for iOS:

- (void)setObject:(id <NSCoding>)object forKey:(NSString *)key
{
    if (!object || !key)
        return;

    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);

    [self setObject:object forKey:key block:^(TMCache *cache, NSString *key, id object) {
        dispatch_semaphore_signal(semaphore);
    }];

    dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);

    #if !OS_OBJECT_USE_OBJC
    dispatch_release(semaphore);
    #endif
}

Line 332 is the final line of the method, and OS_OBJECT_USE_OBJC is true, so I assume this crash is because of dispatch_semaphore_wait.

esilver
  • 27,713
  • 23
  • 122
  • 168
  • Update your question with the `setObject:forKey:` method of your `TMCache` class. Point out line 332. Include other relevant code as needed. – rmaddy Sep 23 '16 at 21:09
  • 2
    The "0x8badf00d" code is usually due to something not completing in a timely manner when the app is in, or returning from, the background. – Phillip Mills Sep 25 '16 at 00:38
  • Did you find solution for this error? I am seeing exactly same Exception Note and Termination Reason. Only difference is my crash log is not symbolicated. Please let me know if you found out the solution or any details about this crash. – Tejas Dec 19 '16 at 12:43
  • I ended up ripping out TMCache and using https://github.com/pinterest/PINCache. You can see there is discussion about this issue with PINCache. – esilver Dec 19 '16 at 18:17

0 Answers0