p2 / OAuth2

OAuth2 framework for macOS and iOS, written in Swift.
Other
1.14k stars 275 forks source link

Crash on 'Cancel' in OAuth2Authorizer iOS #404

Open Ndaz770 opened 1 year ago

Ndaz770 commented 1 year ago

I received a crash report (see below). Probably the same problem as in Crash in iOS OAuth2Authorizer.

Incident Identifier: 1234C205-2B14-4BE3-8A40-7E8B279079F8 Hardware Model: iPhone13,4 Process: Some App [96997] Path: /private/var/containers/Bundle/Application/8C673CD9-A02C-1234-BB19-16982E38341E/Some App.app/Some App Identifier: com.some.bundle.id Version: 2.0.7 (55) AppStoreTools: 14E221 AppVariant: 1:iPhone13,4:16 Beta: YES Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.some.bundle.id [3678]

Date/Time: 2023-06-19 15:23:58.0280 +0200 Launch Time: 2023-06-18 10:56:20.1985 +0200 OS Version: iPhone OS 16.5 (20F66) Release Type: User Baseband Version: 3.70.01 Report Version: 104

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0

Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001db892558 pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001fc6d7118 pthread_kill + 268 (pthread.c:1670) 2 libsystem_c.dylib 0x00000001a3e4f178 abort + 180 (abort.c:118) 3 libswiftCore.dylib 0x0000000196a08ba8 swift::fatalErrorv(unsigned int, char const, char) + 136 (Errors.cpp:378) 4 libswiftCore.dylib 0x0000000196a08bc8 swift::fatalError(unsigned int, char const, ...) + 32 (Errors.cpp:386) 5 libswiftCore.dylib 0x0000000196a08d80 swift::swift_abortRetainUnowned(void const) + 56 (Errors.cpp:445) 6 libswiftCore.dylib 0x0000000196a0d258 swiftunownedRetainStrong + 140 (HeapObject.cpp:651) 7 Some App 0x00000001048c91e8 closure #2 in OAuth2Authorizer.presentAuthorizeView(forURL:intercept:from:) + 80 (OAuth2Authorizer+iOS.swift:278) 8 Some App 0x00000001048cbe68 OAuth2WebViewController.dismiss(asCancel:animated:completion:) + 68 (OAuth2WebViewController+iOS.swift:186) 9 Some App 0x00000001048cbe68 OAuth2WebViewController.cancel(:) + 96 (OAuth2WebViewController+iOS.swift:175) 10 Some App 0x00000001048cbee0 @objc OAuth2WebViewController.cancel(_:) + 44 (:0) 11 UIKitCore 0x000000019ebd81c4 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5685) 12 UIKitCore 0x000000019efaa7bc -[UIBarButtonItem _triggerActionForEvent:fallbackSender:] + 404 (UIBarButtonItem.m:832) 13 UIKitCore 0x000000019ef95240 __45-[_UIButtonBarTargetAction _invoke:forEvent:]_block_invoke + 32 (UIButtonBar.m:1585) 14 UIKitCore 0x000000019ef95140 -[_UIButtonBarTargetAction _invoke:forEvent:] + 196 (UIButtonBar.m:1591) 15 UIKitCore 0x000000019ebd81c4 -[UIApplication sendAction:to:from:forEvent:] + 100 (UIApplication.m:5685) 16 UIKitCore 0x000000019ebd7ec4 -[UIControl sendAction:to:forEvent:] + 112 (UIControl.m:876) 17 UIKitCore 0x000000019ebd7858 -[UIControl _sendActionsForEvents:withEvent:] + 324 (UIControl.m:947) 18 UIKitCore 0x000000019ebd7894 -[UIControl _sendActionsForEvents:withEvent:] + 384 (UIControl.m:955) 19 UIKitCore 0x000000019ebd72bc -[UIControl touchesEnded:withEvent:] + 400 (UIControl.m:639) 20 UIKitCore 0x000000019ea87950 -[UIWindow _sendTouchesForEvent:] + 776 (UIWindow.m:3191) 21 UIKitCore 0x000000019ea86da4 -[UIWindow sendEvent:] + 3284 (UIWindow.m:3491) 22 UIKitCore 0x000000019ea86054 -[UIApplication sendEvent:] + 676 (UIApplication.m:12664) 23 UIKitCore 0x000000019ea84340 dispatchPreprocessedEventFromEventQueue + 1768 (UIEventDispatcher.m:2414) 24 UIKitCore 0x000000019eacd018 processEventQueue + 5576 (UIEventDispatcher.m:2764) 25 UIKitCore 0x000000019f73fe48 updateCycleEntry + 160 (UIEventDispatcher.m:116) 26 UIKitCore 0x000000019efdc4b0 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:114) 27 UIKitCore 0x000000019f640c8c schedulerStepScheduledMainSection + 144 (_UIUpdateScheduler.m:1015) 28 UIKitCore 0x000000019f6401e8 runloopSourceCallback + 92 (_UIUpdateScheduler.m:1164) 29 CoreFoundation 0x000000019c9f2128 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 (CFRunLoop.c:1957) 30 CoreFoundation 0x000000019c9fe7b4 CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001) 31 CoreFoundation 0x000000019c9835e8 CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038) 32 CoreFoundation 0x000000019c9990d4 CFRunLoopRun + 828 (CFRunLoop.c:2953) 33 CoreFoundation 0x000000019c99e3ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 34 GraphicsServices 0x00000001d7e6335c GSEventRunModal + 164 (GSEvent.c:2196) 35 UIKitCore 0x000000019ed2b6e8 -[UIApplication run] + 888 (UIApplication.m:3782) 36 UIKitCore 0x000000019ed2b34c UIApplicationMain + 340 (UIApplication.m:5372) 37 SwiftUI 0x00000001a036f41c closure #1 in KitRendererCommon(:) + 176 (UIKitApp.swift:37) 38 SwiftUI 0x00000001a02d59bc runApp(_:) + 152 (UIKitApp.swift:14) 39 SwiftUI 0x00000001a02bfa64 static App.main() + 128 (App.swift:114) 40 Some App 0x0000000104406cb8 static SomeApp.main() + 52 (App.swift:16) 41 Some App 0x0000000104406cb8 static SomeApp.$main() + 52 (:13) 42 Some App 0x0000000104406cb8 main + 64 (SomeView.swift:0) 43 dyld 0x00000001bbe9edec start + 2220 (dyldMain.cpp:1165)

Thread 1: 0 libsystem_pthread.dylib 0x00000001fc6d0b74 start_wqthread + 0 (:-1)

Thread 2: 0 libsystem_pthread.dylib 0x00000001fc6d0b74 start_wqthread + 0 (:-1)

Thread 3: 0 libsystem_pthread.dylib 0x00000001fc6d0b74 start_wqthread + 0 (:-1)

Thread 4: 0 libsystem_kernel.dylib 0x00000001db88bc84 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001db89eb54 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001db89ee2c mach_msg_overwrite + 540 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001db88c1c8 mach_msg + 24 (mach_msg.c:323) 4 Some App 0x0000000104608cc0 exception_server_thread + 188 (PLCrashMachExceptionServer.m:674) 5 libsystem_pthread.dylib 0x00000001fc6d16b8 _pthread_start + 148 (pthread.c:893) 6 libsystem_pthread.dylib 0x00000001fc6d0b88 thread_start + 8 (:-1)

Thread 5 name: Thread 5: 0 libsystem_kernel.dylib 0x00000001db88bc84 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001db89eb54 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001db89ee2c mach_msg_overwrite + 540 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001db88c1c8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x000000019c998024 CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x000000019c999250 CFRunLoopRun + 1208 (CFRunLoop.c:3005) 6 CoreFoundation 0x000000019c99e3ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 Foundation 0x0000000196c1efd4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373) 8 Foundation 0x0000000196c1eebc -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420) 9 UIKitCore 0x000000019ee5e3fc -[UIEventFetcher threadMain] + 416 (UIEventFetcher.m:1376) 10 Foundation 0x0000000196c38544 NSThreadstart__ + 716 (NSThread.m:963) 11 libsystem_pthread.dylib 0x00000001fc6d16b8 _pthread_start + 148 (pthread.c:893) 12 libsystem_pthread.dylib 0x00000001fc6d0b88 thread_start + 8 (:-1)

Thread 6 name: Thread 6: 0 libsystem_kernel.dylib 0x00000001db88bc84 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001db89eb54 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001db89ee2c mach_msg_overwrite + 540 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001db88c1c8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x000000019c998024 CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x000000019c999250 CFRunLoopRun + 1208 (CFRunLoop.c:3005) 6 CoreFoundation 0x000000019c99e3ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 CoreFoundation 0x000000019c9e0ea4 CFRunLoopRun + 64 (CFRunLoop.c:3444) 8 CoreMotion 0x00000001a7f22248 CLMotionCore::runMotionThread(void*) + 1208 (CLMotionCore.mm:376) 9 libsystem_pthread.dylib 0x00000001fc6d16b8 _pthread_start + 148 (pthread.c:893) 10 libsystem_pthread.dylib 0x00000001fc6d0b88 thread_start + 8 (:-1)

Thread 7 name: Thread 7: 0 libsystem_kernel.dylib 0x00000001db88bc84 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001db89eb54 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001db89ee2c mach_msg_overwrite + 540 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001db88c1c8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x000000019c998024 CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x000000019c999250 CFRunLoopRun + 1208 (CFRunLoop.c:3005) 6 CoreFoundation 0x000000019c99e3ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 CFNetwork 0x000000019db89580 +[CFN_CoreSchedulingSetRunnable _run:] + 392 (CoreSchedulingSet.mm:1562) 8 Foundation 0x0000000196c38544 NSThreadstart + 716 (NSThread.m:963) 9 libsystem_pthread.dylib 0x00000001fc6d16b8 _pthread_start + 148 (pthread.c:893) 10 libsystem_pthread.dylib 0x00000001fc6d0b88 thread_start + 8 (:-1)

Thread 8 name: Thread 8: 0 libsystem_kernel.dylib 0x00000001db88c558 __psynch_cvwait + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001fc6d8078 _pthread_cond_wait + 1232 (pthread_cond.c:862) 2 JavaScriptCore 0x00000001b0167fcc scavenger_thread_main + 1428 (pas_scavenger.c:359) 3 libsystem_pthread.dylib 0x00000001fc6d16b8 _pthread_start + 148 (pthread.c:893) 4 libsystem_pthread.dylib 0x00000001fc6d0b88 thread_start + 8 (:-1)

Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0xffffffffffffc380 x5: 0x0000000000000020 x6: 0x0000000280ee65a0 x7: 0x0000000000000003 x8: 0x7dfa116347455ed3 x9: 0x7dfa1162b4615a13 x10: 0x000092f359a20000 x11: 0x0000000280ee4000 x12: 0x0000000000000070 x13: 0x00000000001ff800 x14: 0x00000000000007fb x15: 0x000000009f403857 x16: 0x0000000000000148 x17: 0x00000001f32404c0 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x0000000000000103 x21: 0x00000001f32405a0 x22: 0x0000000000000063 x23: 0x000000014babe5d0 x24: 0x00000001f32b64f0 x25: 0x0000000282bdfe70 x26: 0x0000000198448fbc x27: 0x0000000282587f40 x28: 0x0000000000000002 fp: 0x000000016b9fce60 lr: 0x00000001fc6d7118 sp: 0x000000016b9fce40 pc: 0x00000001db892558 cpsr: 0x40001000 esr: 0x56000080 Address size fault

Binary Images: 0x104400000 - 0x1049e3fff Some App arm64 <0e441ad44d1731809e7ced0e610eb10a> /private/var/containers/Bundle/Application/8C673CD9-A02C-4902-BB19-16982E38341E/Some App.app/Some App 0x104c98000 - 0x10533bfff GSSDKCore arm64 <608a7ea235a33d5e847eda3622aa5070> /private/var/containers/Bundle/Application/8C673CD9-A02C-4902-BB19-16982E38341E/Some App.app/Frameworks/GSSDKCore.framework/GSSDKCore 0x10545c000 - 0x10568bfff GSSDKOCR arm64 <405bdc5306f1332b85b0f408193f23e9> /private/var/containers/Bundle/Application/8C673CD9-A02C-4902-BB19-16982E38341E/Some App.app/Frameworks/GSSDKOCR.framework/GSSDKOCR 0x1076f8000 - 0x107703fff libobjc-trampolines.dylib arm64e <695a8449aae838b6851cced0b1176f03> /private/preboot/Cryptexes/OS/usr/lib/libobjc-trampolines.dylib 0x113034000 - 0x113047fff GAXClient arm64e <4b02f071524f355e95a419c5a5d20dec> /System/Library/AccessibilityBundles/GAXClient.bundle/GAXClient 0x196650000 - 0x196ba8fff libswiftCore.dylib arm64e /usr/lib/swift/libswiftCore.dylib 0x196bdd000 - 0x1974bafff Foundation arm64e <6e76dc9611af3b2eb71e215f9cc6e822> /System/Library/Frameworks/Foundation.framework/Foundation 0x19c91f000 - 0x19cd06fff CoreFoundation arm64e <4230c12242e8383bbeecee7b61f8bb61> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 0x19d930000 - 0x19dcfbfff CFNetwork arm64e <6aafe7c4f1c43020ad1670591c86d7b0> /System/Library/Frameworks/CFNetwork.framework/CFNetwork 0x19e98e000 - 0x1a01b2fff UIKitCore arm64e /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore 0x1a01b3000 - 0x1a1b28fff SwiftUI arm64e /System/Library/Frameworks/SwiftUI.framework/SwiftUI 0x1a3e32000 - 0x1a3eafff3 libsystem_c.dylib arm64e <3548f8ee7a073b678d699c7d42096513> /usr/lib/system/libsystem_c.dylib 0x1a7f0f000 - 0x1a831efff CoreMotion arm64e <5798cb68a1343bfcb7b2a335020421c4> /System/Library/Frameworks/CoreMotion.framework/CoreMotion 0x1b0054000 - 0x1b177afff JavaScriptCore arm64e /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore 0x1bbe89000 - 0x1bbf0ea23 dyld arm64e <8a423f3fb318315e99c705ee532e9c0d> /usr/lib/dyld 0x1d7e62000 - 0x1d7e6afff GraphicsServices arm64e /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices 0x1db88b000 - 0x1db8c2ff7 libsystem_kernel.dylib arm64e <2f78311097393f18a2345fb92512529d> /usr/lib/system/libsystem_kernel.dylib 0x1fc6d0000 - 0x1fc6dbff3 libsystem_pthread.dylib arm64e <8894310a745f340799f01fd54442561d> /usr/lib/system/libsystem_pthread.dylib

EOF

ossus-lib commented 5 months ago

Try switching to ASWebAuthentication session, the custom web view controller shouldn't be used anymore.