andrewcbancroft / SwiftyLocalReceiptValidator

An implementation of local receipt validation logic for iOS in Swift
MIT License
286 stars 32 forks source link

Rare Crash in ReceiptValidator.deviceIdentifierData #11

Open nibe opened 5 years ago

nibe commented 5 years ago

Here's a rare crash:

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [12610]

Thread 0 Crashed:
0   ...         0x000000010083b5e6 ReceiptValidator.deviceIdentifierData() (in ...) (ReceiptValidator.swift:138)
1   ...         0x000000010083b00a ReceiptValidator.validateHash(receipt:) (in ...) (ReceiptValidator.swift:168)
2   ...         0x0000000100839c1b ReceiptValidator.validateReceipt() (in ...) (ReceiptValidator.swift:99)
3   ...         ...
4   ...         ...
5   ...         ...
6   com.apple.Foundation            0x00007fff30658646 __NSFireTimer + 80
7   com.apple.CoreFoundation        0x00007fff2e2c7dfd __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
8   com.apple.CoreFoundation        0x00007fff2e2c79b0 __CFRunLoopDoTimer + 859
9   com.apple.CoreFoundation        0x00007fff2e2c74f0 __CFRunLoopDoTimers + 333
10  com.apple.CoreFoundation        0x00007fff2e2a86fe __CFRunLoopRun + 2119
11  com.apple.CoreFoundation        0x00007fff2e2a7c64 CFRunLoopRunSpecific + 463
12  com.apple.HIToolbox             0x00007fff2d53eab5 RunCurrentEventLoopInMode + 293
13  com.apple.HIToolbox             0x00007fff2d53e7eb ReceiveNextEventCommon + 618
14  com.apple.HIToolbox             0x00007fff2d53e568 _BlockUntilNextEventMatchingListInModeWithFilter + 64
15  com.apple.AppKit                0x00007fff2b7f9363 _DPSNextEvent + 997
16  com.apple.AppKit                0x00007fff2b7f8102 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
17  com.apple.AppKit                0x00007fff2b7f2165 -[NSApplication run] + 699
18  com.apple.AppKit                0x00007fff2b7e18a3 NSApplicationMain + 780
19  ...         0x00000001008201d9 main (in ...) (AppDelegate.swift:15)
20  libdyld.dylib                   0x00007fff5b4f5ed9 start + 1

ReceiptValidator.swift:138:

macAddress = IORegistryEntryCreateCFProperty(parentService, "IOMACAddress" as CFString, kCFAllocatorDefault, 0).takeRetainedValue() as? NSData