sumup / sumup-ios-sdk

Other
46 stars 25 forks source link

Crash on 4.2.1 when connecting to reader #116

Closed ls-philipp-jacob closed 11 months ago

ls-philipp-jacob commented 2 years ago

After updating to the latest version of the SDK (4.2.1) I experience a crash. The Bluetooth pairing with the reader succeeds but when the SDK tries to connect the crash happens right away. Any ideas?

Running on iOS 15.5 Built with Xcode 13.3.1

 Fatal Exception: NSInvalidArgumentException
*** NSAllocateMemoryPages(18446744073709551615) failed
Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x92d0c __exceptionPreprocess
1  libobjc.A.dylib                0x14ee4 objc_exception_throw
2  Foundation                     0x7abcc NSAllocateMemoryPages
3  Foundation                     0x28a34 -[_NSPlaceholderData initWithBytes:length:copy:deallocator:]
4  Foundation                     0x3bbdc +[NSData(NSData) dataWithBytes:length:]
5  SumUpSDK                       0x11752c (Missing UUID 2179df09fbe430e9b68b356688862e85)
6  SumUpSDK                       0x1123d0 (Missing UUID 2179df09fbe430e9b68b356688862e85)
7  SumUpSDK                       0x6f97c (Missing UUID 2179df09fbe430e9b68b356688862e85)
8  libdispatch.dylib              0x63094 _dispatch_call_block_and_release
9  libdispatch.dylib              0x64094 _dispatch_client_callout
10 libdispatch.dylib              0x10d44 _dispatch_main_queue_drain
11 libdispatch.dylib              0x10994 _dispatch_main_queue_callback_4CF$VARIANT$mp
12 CoreFoundation                 0x4e0c4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
13 CoreFoundation                 0xb5e8 __CFRunLoopRun
14 CoreFoundation                 0x1e240 CFRunLoopRunSpecific
15 GraphicsServices               0x1988 GSEventRunModal
16 UIKitCore                      0x4e541c -[UIApplication _run]
17 UIKitCore                      0x27eb88 UIApplicationMain
18 iCash                          0x405e24 main + 14 (main.m:14)
19 ???                            0x1027643d0 (Missing)
ls-philipp-jacob commented 1 year ago

Using Xcode 14.3.1 and iOS 16.4 I still observe the crash with the latest SDK version 4.3.4:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x957c __exceptionPreprocess
1  libobjc.A.dylib                0x15050 objc_exception_throw
2  Foundation                     0xa9920 NSAllocateMemoryPages
3  Foundation                     0x4c258 -[_NSPlaceholderData initWithBytes:length:copy:deallocator:]
4  Foundation                     0x4bd98 +[NSData(NSData) dataWithBytes:length:]
5  SumUpSDK                       0xd6de8 (Missing UUID 9c5cbec57dc43a9c85b21334109a8d88)
6  SumUpSDK                       0x102080 (Missing UUID 9c5cbec57dc43a9c85b21334109a8d88)
7  SumUpSDK                       0x5d30c (Missing UUID 9c5cbec57dc43a9c85b21334109a8d88)
8  libdispatch.dylib              0x637a8 _dispatch_call_block_and_release
9  libdispatch.dylib              0x64780 _dispatch_client_callout
10 libdispatch.dylib              0x10bdc _dispatch_main_queue_drain
11 libdispatch.dylib              0x1082c _dispatch_main_queue_callback_4CF$VARIANT$mp
12 CoreFoundation                 0x91b1c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
13 CoreFoundation                 0x757b8 __CFRunLoopRun
14 CoreFoundation                 0x79e90 CFRunLoopRunSpecific
15 GraphicsServices               0x1998 GSEventRunModal
16 UIKitCore                      0x370bb8 -[UIApplication _run]
17 UIKitCore                      0x370830 UIApplicationMain
18 iCash                          0x34e25c main + 14 (main.m:14)
19 ???                            0x1a7977344 (Missing)
jadeburton-sumup commented 1 year ago

Hi @ls-philipp-jacob, thanks for reporting this. We're looking at it.

ls-philipp-jacob commented 11 months ago

It turned out to be caused by a name conflict of a category method on a Foundation class. Quite unlikely to happen. Very easy to avoid. I removed to conflicting category in our code and the crashes are gone. Thanks a lot for your support!