How to handle crash from notification service extension crash? - ios

Getting weird from notification service extension
I think this might be due to sending of AWS event from receivedNotification method which might be taking more time that causes OS killing it. if this the scenario then how should i handle the crash and prevent it.
please check the crash logs,
Exception Type: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace ASSERTIOND, Code 0xdead10cc
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001c829bed0 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001c829b3a8 mach_msg + 72
2 CoreFoundation 0x00000001c869fbc4 __CFRunLoopServiceMachPort + 236
3 CoreFoundation 0x00000001c869aa60 __CFRunLoopRun + 1396
4 CoreFoundation 0x00000001c869a1cc CFRunLoopRunSpecific + 436
5 Foundation 0x00000001c908f404 -[NSRunLoop+ 33796 (NSRunLoop) runMode:beforeDate:] + 300
6 Foundation 0x00000001c90cadf4 -[NSRunLoop+ 278004 (NSRunLoop) run] + 88
7 libxpc.dylib 0x00000001c836c070 _xpc_objc_main + 516
8 libxpc.dylib 0x00000001c836ea30 xpc_main + 180
9 Foundation 0x00000001c90ccdb0 +[NSXPCListener serviceListener] + 0
10 PlugInKit 0x00000001ce2eb498 0x1ce2d8000 + 79000
11 PlugInKit 0x00000001ce2eb2c4 0x1ce2d8000 + 78532
12 PlugInKit 0x00000001ce2eb848 0x1ce2d8000 + 79944
13 Foundation 0x00000001c92b46bc NSExtensionMain + 64
14 libdyld.dylib 0x00000001c815abb4 start + 4

#Sumeet.Jain you need to set debug executable on your extension
project their are some steps here.
step 1: select your service extension project to run
step 2: you will see list of your project below some option "SELECT EDIT SCHEME" option
step 3: after then you have to go for RUN -> INFO -> EXECUTABLE
step 4: and you should change "ASK TO LAUNCH" to "YOUR PROJECT"
THATS IT.

Related

AVAudioEngineImpl::IOUnitConfigurationChanged() Crash

I use AudioEngine.
In crash reports I see some random EXC_BREAKPOINT crashes with this stacktrace
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001896df0e4
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [12467]
Triggered by Thread: 15
Thread 15 Crashed:
0 libdispatch.dylib 0x00000001896df0e4 __DISPATCH_WAIT_FOR_QUEUE__ + 448 (queue.c:1619)
1 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732)
2 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732)
3 AVFAudio 0x00000001965b11a8 -[AVAudioEngine dealloc] + 308 (AVAudioEngine.mm:406)
4 Foundation 0x0000000189ce52ac -[NSConcreteNotification dealloc] + 68 (NSNotification.m:206)
5 AVFAudio 0x00000001965b7158 invocation function for block in AVAudioEngineImpl::IOUnitConfigurationChanged() + 292 (AVAudioEngine.mm:1215)
6 libdispatch.dylib 0x00000001896de998 _dispatch_block_async_invoke2 + 104 (queue.c:525)
7 libdispatch.dylib 0x00000001896fb184 _dispatch_client_callout + 16 (object.m:495)
8 libdispatch.dylib 0x00000001896d4e8c _dispatch_continuation_pop$VARIANT$armv81 + 404 (inline_internal.h:2484)
9 libdispatch.dylib 0x00000001896e502c _dispatch_source_invoke$VARIANT$armv81 + 1232 (source.c:568)
10 libdispatch.dylib 0x00000001896d85e0 _dispatch_lane_serial_drain$VARIANT$armv81 + 260 (inline_internal.h:2525)
11 libdispatch.dylib 0x00000001896d9128 _dispatch_lane_invoke$VARIANT$armv81 + 400 (queue.c:3863)
12 libdispatch.dylib 0x00000001896e243c _dispatch_workloop_worker_thread + 576 (queue.c:6445)
13 libsystem_pthread.dylib 0x000000018974ab88 _pthread_wqthread + 276 (pthread.c:2351)
14 libsystem_pthread.dylib 0x000000018974d760 start_wqthread + 8
I can't reproduce this crash and stacktrace doesn't point to my code. Does anyone know what is cause of this crash, how this can be fixed and if it's even possible to fix?
Thanks
According to the apple documentation of AVAudioEngineConfigurationChange,
You must not release the engine during handling this notification.
Note The engine must not be deallocated from within the client's
notification handler. Callback happens on an internal dispatch queue
and can deadlock while trying to teardown the engine synchronously.
Though you didn't release at that time, It can be caused.
AVAudioEngine in iOS 11 or 12 can be stucked to notify before, then you release engine later.
There's workaround. You have to re-use the audio engine rather than re-create.

Flutter - Phone Auth Verification ID is getting null sometimes for iOS

My App got rejected 4th time in review from Apple team, they are saying App is crashing on tap of verify OTP button. They have shared a crash log, After checking the log I got to know that app is crashing due to null verification ID.
However everything is working perfectly locally and Android version is live, I have tested in real device & in emulator. Now I am not able to understand why verification ID is getting null sometime. I have already added try catch to handle exception, But that is not working in iOS, But working in Android.
Can someone please help me on this.
Below is the crash log...
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 9
Last Exception Backtrace:
(0x1ae904a48 0x1ae62bfa4 0x1ae8085a8 0x1ae908af4 0x1ae90aa7c 0x10264cc88 0x102648d58 0x1026489ec 0x1ae5d0610 0x1ae5d1184 0x1ae57d404 0x1ae57ddf8 0x1ae587314 0x1ae620b88 0x1ae623760)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_kernel.dylib 0x00000001ae6da634 0x1ae6d7000 + 13876
1 libsystem_kernel.dylib 0x00000001ae6d9aa0 0x1ae6d7000 + 10912
2 CoreFoundation 0x00000001ae882288 0x1ae7d9000 + 692872
3 CoreFoundation 0x00000001ae87d3a8 0x1ae7d9000 + 672680
4 CoreFoundation 0x00000001ae87cadc 0x1ae7d9000 + 670428
5 GraphicsServices 0x00000001b8802328 0x1b87ff000 + 13096
6 UIKitCore 0x00000001b2977ae0 0x1b1f74000 + 10500832
7 Runner 0x000000010263edf4 0x102638000 + 28148
8 libdyld.dylib 0x00000001ae706360 0x1ae705000 + 4960
Thread 1 name: com.apple.uikit.eventfetch-thread
Thread 1:
0 libsystem_kernel.dylib 0x00000001ae6da634 0x1ae6d7000 + 13876
1 libsystem_kernel.dylib 0x00000001ae6d9aa0 0x1ae6d7000 + 10912
2 CoreFoundation 0x00000001ae882288 0x1ae7d9000 + 692872
3 CoreFoundation 0x00000001ae87d3a8 0x1ae7d9000 + 672680
4 CoreFoundation 0x00000001ae87cadc 0x1ae7d9000 + 670428
5 Foundation 0x00000001aebbc7f4 0x1aebb5000 + 30708
6 Foundation 0x00000001aebbc6d4 0x1aebb5000 + 30420
7 UIKitCore 0x00000001b2a10204 0x1b1f74000 + 11125252
8 Foundation 0x00000001aeced0a4 0x1aebb5000 + 1278116
9 libsystem_pthread.dylib 0x00000001ae61fd8c 0x1ae615000 + 44428
10 libsystem_pthread.dylib 0x00000001ae62376c 0x1ae615000 + 59244

iOS React Native Testflight EXC_CRASH(SIGABRT) only for the Apple Tester

For some reasons our internal testers was able to run the app but somehow the apple beta tester says the app crashes as soon as the app launches. They provided me with this error
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 1
Application Specific Information:
abort() called
Last Exception Backtrace:
(0x18d80827c 0x18c9e29f8 0x101124b94 0x101121108 0x18d80f900 0x18d6f14d0 0x18d6f2104 0x101137f20 0x1011778b4 0x101177614 0x18d247a38 0x18d2487d4 0x18d1f1324 0x18d1f1e40 0x18d1fa4ac 0x18d428114 0x18d42acd4)
Thread 1 name: Dispatch queue:com.facebook.react.ExceptionsManagerQueue
Thread 1 Crashed:
0 libsystem_kernel.dylib 0x000000018d3a50dc 0x18d382000 + 143580
1 libsystem_pthread.dylib 0x000000018d41e094 0x18d41c000 + 8340
2 libsystem_c.dylib 0x000000018d2feea8 0x18d2a4000 + 372392
3 libc++abi.dylib 0x000000018c9cb788 0x18c9ca000 + 6024
4 libc++abi.dylib 0x000000018c9cb934 0x18c9ca000 + 6452
5 libobjc.A.dylib 0x000000018c9e2e00 0x18c9dd000 + 24064
6 libc++abi.dylib 0x000000018c9d7838 0x18c9ca000 + 55352
7 libc++abi.dylib 0x000000018c9d78c4 0x18c9ca000 + 55492
8 libdispatch.dylib 0x000000018d2487e8 0x18d1e8000 + 395240
9 libdispatch.dylib 0x000000018d1f1324 0x18d1e8000 + 37668
10 libdispatch.dylib 0x000000018d1f1e40 0x18d1e8000 + 40512
11 libdispatch.dylib 0x000000018d1fa4ac 0x18d1e8000 + 74924
12 libsystem_pthread.dylib 0x000000018d428114 0x18d41c000 + 49428
13 libsystem_pthread.dylib 0x000000018d42acd4 0x18d41c000 + 60628
im really not sure why the apple developer is experiencing crashes while the rest of the team was able to run the app normally through the testflight

2.1 - Apps that crash will be rejected

I made a PhoneGap/cordova app with Sencha Touch. When I build it in newest stable XCode and using the Developer key/prov. profile, I can deploy it to my iPhone and browse the interface. But when I then submit it to apple using the deployment key, I get:
We were unable to review your app, as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.
and the log contains like:
Last Exception Backtrace:
(0x1831e42d8 0x1949040e4 0x1831e3f5c 0x18401d480 0x18310f520 0x1880447a0 0x1880465a8 0x187eb1ec4 0x187eb10e0 0x187eaf778 0x18b8c53c8 0x18319c27c 0x18319b384 0x1831999a8 0x1830c52d4 0x187c9043c 0x187c8afac 0x10007afec 0x194f82a08)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019509b270 0x195080000 + 111216
1 libsystem_pthread.dylib 0x000000019513916c 0x195134000 + 20844
2 libsystem_c.dylib 0x0000000195012b14 0x194fb0000 + 404244
3 libc++abi.dylib 0x00000001940d1414 0x1940d0000 + 5140
4 libc++abi.dylib 0x00000001940f0b88 0x1940d0000 + 134024
5 libobjc.A.dylib 0x00000001949043bc 0x1948fc000 + 33724
6 libc++abi.dylib 0x00000001940edbb0 0x1940d0000 + 121776
7 libc++abi.dylib 0x00000001940ed738 0x1940d0000 + 120632
8 libobjc.A.dylib 0x0000000194904290 0x1948fc000 + 33424
9 CoreFoundation 0x00000001830c5380 0x1830bc000 + 37760
10 UIKit 0x0000000187c90438 0x187c14000 + 508984
11 UIKit 0x0000000187c8afa8 0x187c14000 + 487336
12 lightController 0x000000010007afe8 0x100074000 + 28648
13 libdyld.dylib 0x0000000194f82a04 0x194f80000 + 10756
with (12) being my app. I am not sure how this log may help. How can I get to the root of the problem? (As I said, deploying to my iPhone works!)

ios app runs perfectly in debug mode but crashes in release

My app crashes in certain moments in release build. I don't know if it is important but I use mainly c++ with cocos2d-x framework. I tried setting optimization level to none but it won't work too. I get this output in console :
libc++abi.dylib: terminating with uncaught exception of type std::out_of_range: map::at: key not found
This is part of the crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3870d1f0 0x386fa000 + 78320
1 libsystem_pthread.dylib 0x38777792 0x38774000 + 14226
2 libsystem_c.dylib 0x386bdfd8 0x38675000 + 298968
3 libc++abi.dylib 0x379eccd2 0x379ec000 + 3282
4 libc++abi.dylib 0x37a056aa 0x379ec000 + 104106
5 libobjc.A.dylib 0x3814af86 0x38147000 + 16262
6 libc++abi.dylib 0x37a031c4 0x379ec000 + 94660
7 libc++abi.dylib 0x37a02d28 0x379ec000 + 93480
8 libobjc.A.dylib 0x3814ae12 0x38147000 + 15890
9 CoreFoundation 0x2d3d2f80 0x2d3cb000 + 32640
10 CoreFoundation 0x2d3d2cee 0x2d3cb000 + 31982
11 GraphicsServices 0x3230565e 0x322fc000 + 38494
12 UIKit 0x2fd1e168 0x2fcb0000 + 450920
13 BumpRace iOS 0x00044b1e 0x4000 + 264990
14 libdyld.dylib 0x38657ab4 0x38656000 + 6836
Any help would be apprieciated.
You must use iOS instruments tool. To debug you memory leaks. As possible to conclude from youre ERROR message.
Small useful link.

Resources