alexhaugland / moonlight-ios

GameStream client for iOS/tvOS
GNU General Public License v3.0
38 stars 10 forks source link

Manual Fix #15

Open goast-ai[bot] opened 2 months ago

goast-ai[bot] commented 2 months ago

Link to Goast Fix

  1. /Limelight/Network/HttpManager.m Update the getCertificate: method to check if the identity is nil before attempting to copy the certificate. If the identity is nil, log an error and return nil. Also, check the status of SecIdentityCopyCertificate and log an error if it fails.
  2. /Limelight/Network/HttpManager.m Update the URLSession:didReceiveChallenge:completionHandler: method to check if the certificate array returned by getCertificate: is nil before creating the NSURLCredential. If the certificate array is nil, log an error and call the completion handler with NSURLSessionAuthChallengePerformDefaultHandling.

Stack Trace

Incident Identifier: 2B5B43F0-F559-4671-BBAB-62EF15C963B3
Hardware Model:      RealityDevice14,1
Process:             Moonlight Vision [519]
Path:                /private/var/containers/Bundle/Application/9F08D7E2-E1C2-4512-B240-71D93BE4EF8D/Moonlight Vision.app/Moonlight Vision
Identifier:          com.moonlight-stream-beta.Moonlight-Vision
Version:             9.0.1 (14)
AppStoreTools:       15F31e
AppVariant:          1:RealityDevice14,1:1.1
Beta:                YES
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.moonlight-stream-beta.Moonlight-Vision [596]

Date/Time:           2024-07-29 20:04:53.7103 +0800
Launch Time:         2024-07-29 20:04:42.5660 +0800
OS Version:          xrOS 1.2 (21O589)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Codes: 0x0000000000000001, 0x0000000000000010
VM Region Info: 0x10 is not in any region.  Bytes before following region: 4341956592
      REGION TYPE                 START - END      [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                   102cd0000-102cfc000 [  176K] r-x/r-x SM=COW  /var/containers/Bundle/Application/9F08D7E2-E1C2-4512-B240-71D93BE4EF8D/Moonlight Vision.app/Moonlight Vision
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [519]

Triggered by Thread:  3

Thread 0 name:
Thread 0:
0   libsystem_kernel.dylib          0x000000024aca25c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib          0x000000024acaa6b4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib          0x000000024acaa948 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib          0x000000024acaa788 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                  0x00000001a604c988 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                  0x00000001a6046c40 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                  0x00000001a6046364 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   GraphicsServices                0x00000001e1d364f8 GSEventRunModal + 164 (GSEvent.c:2196)
8   UIKitCore                       0x00000002327832bc -[UIApplication _run] + 888 (UIApplication.m:3713)
9   UIKitCore                       0x0000000232787b1c UIApplicationMain + 340 (UIApplication.m:5303)
10  SwiftUI                         0x00000001b698b710 closure #1 in KitRendererCommon(_:) + 168 (UIKitApp.swift:51)
11  SwiftUI                         0x00000001b698b56c runApp<A>(_:) + 152 (UIKitApp.swift:14)
12  SwiftUI                         0x00000001b653afa4 static App.main() + 132 (App.swift:114)
13  Moonlight Vision                0x0000000102cfd5bc static MainWrapper.main() + 76 (MoonlightVisionApp.swift:21)
14  Moonlight Vision                0x0000000102cfd5bc static MainWrapper.$main() + 76 (<compiler-generated>:17)
15  Moonlight Vision                0x0000000102cfd5bc main + 88 (MoonlightVisionApp.swift:0)
16  dyld                            0x0000000243c498b8 start + 2204 (dyldMain.cpp:1298)

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

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

Thread 3 name:
Thread 3 Crashed:
0   Security                        0x00000001b4d1b458 SecIdentityCopyCertificate + 12 (SecIdentity.c:81)
1   Moonlight Vision                0x0000000102ce06f4 -[HttpManager getCertificate:] + 28 (HttpManager.m:328)
2   Moonlight Vision                0x0000000102ce099c -[HttpManager URLSession:didReceiveChallenge:completionHandler:] + 372 (HttpManager.m:400)
3   CFNetwork                       0x00000001a4073350 __73-[__NSCFURLSessionDelegateWrapper didReceiveChallenge:completionHandler:]_block_invoke + 156 (SessionDelegateWrapper.mm:237)
4   libdispatch.dylib               0x000000024aafa4bc _dispatch_call_block_and_release + 32 (init.c:1530)
5   libdispatch.dylib               0x000000024aafbf9c _dispatch_client_callout + 20 (object.m:576)
6   libdispatch.dylib               0x000000024ab0314c _dispatch_lane_serial_drain + 728 (queue.c:3900)
7   libdispatch.dylib               0x000000024ab03c78 _dispatch_lane_invoke + 432 (queue.c:3991)
8   libdispatch.dylib               0x000000024ab0e4c0 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
9   libdispatch.dylib               0x000000024ab0dd60 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
10  libsystem_pthread.dylib         0x000000024ad8120c _pthread_wqthread + 288 (pthread.c:2696)
11  libsystem_pthread.dylib         0x000000024ad885a0 start_wqthread + 8 (:-1)

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

Thread 5 name:
Thread 5:
0   libsystem_kernel.dylib          0x000000024aca2544 semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib               0x000000024aafc514 _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib               0x000000024aafcb94 _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   Moonlight Vision                0x0000000102cdf9d0 -[HttpManager executeRequestSynchronously:] + 212 (HttpManager.m:156)
4   Moonlight Vision                0x0000000102ce8008 -[PairManager initiatePairWithPin:forServerMajorVersion:withState:] + 344 (PairManager.m:98)
5   Moonlight Vision                0x0000000102ce7ce4 -[PairManager main] + 392 (PairManager.m:47)
6   Foundation                      0x00000001aa430b00 __NSOPERATION_IS_INVOKING_MAIN__ + 16 (NSOperation.m:2189)
7   Foundation                      0x00000001aa42cdf8 -[NSOperation start] + 648 (NSOperation.m:1406)
8   Foundation                      0x00000001aa4313b4 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 16 (NSOperation.m:2220)
9   Foundation                      0x00000001aa430fe4 __NSOQSchedule_f + 172 (NSOperation.m:2231)
10  libdispatch.dylib               0x000000024ab0a7b8 _dispatch_block_async_invoke2 + 128 (queue.c:570)
11  libdispatch.dylib               0x000000024aafbf9c _dispatch_client_callout + 20 (object.m:576)
12  libdispatch.dylib               0x000000024aaff324 _dispatch_continuation_pop + 580 (queue.c:321)
13  libdispatch.dylib               0x000000024aafe974 _dispatch_async_redirect_invoke + 584 (queue.c:845)
14  libdispatch.dylib               0x000000024ab0d0d8 _dispatch_root_queue_drain + 372 (queue.c:7136)
15  libdispatch.dylib               0x000000024ab0d8e0 _dispatch_worker_thread2 + 156 (queue.c:7204)
16  libsystem_pthread.dylib         0x000000024ad811d0 _pthread_wqthread + 228 (pthread.c:2709)
17  libsystem_pthread.dylib         0x000000024ad885a0 start_wqthread + 8 (:-1)

Thread 6 name:
Thread 6:
0   libsystem_kernel.dylib          0x000000024aca2544 semaphore_wait_trap + 8 (:-1)
1   libdispatch.dylib               0x000000024aafc514 _dispatch_sema4_wait + 28 (lock.c:139)
2   libdispatch.dylib               0x000000024aafcb94 _dispatch_semaphore_wait_slow + 132 (semaphore.c:132)
3   Moonlight Vision                0x0000000102cdf9d0 -[HttpManager executeRequestSynchronously:] + 212 (HttpManager.m:156)
4   Moonlight Vision                0x0000000102ce86dc -[PairManager initiatePairWithPin:forServerMajorVersion:withState:] + 2092 (PairManager.m:204)
5   Moonlight Vision                0x0000000102ce7ce4 -[PairManager main] + 392 (PairManager.m:47)
6   Foundation                      0x00000001aa430b00 __NSOPERATION_IS_INVOKING_MAIN__ + 16 (NSOperation.m:2189)
7   Foundation                      0x00000001aa42cdf8 -[NSOperation start] + 648 (NSOperation.m:1406)
8   Foundation                      0x00000001aa4313b4 __NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 16 (NSOperation.m:2220)
9   Foundation                      0x00000001aa430fe4 __NSOQSchedule_f + 172 (NSOperation.m:2231)
10  libdispatch.dylib               0x000000024ab0a7b8 _dispatch_block_async_invoke2 + 128 (queue.c:570)
11  libdispatch.dylib               0x000000024aafbf9c _dispatch_client_callout + 20 (object.m:576)
12  libdispatch.dylib               0x000000024aaff324 _dispatch_continuation_pop + 580 (queue.c:321)
13  libdispatch.dylib               0x000000024aafe974 _dispatch_async_redirect_invoke + 584 (queue.c:845)
14  libdispatch.dylib               0x000000024ab0d0d8 _dispatch_root_queue_drain + 372 (queue.c:7136)
15  libdispatch.dylib               0x000000024ab0d8e0 _dispatch_worker_thread2 + 156 (queue.c:7204)
16  libsystem_pthread.dylib         0x000000024ad811d0 _pthread_wqthread + 228 (pthread.c:2709)
17  libsystem_pthread.dylib         0x000000024ad885a0 start_wqthread + 8 (:-1)

Thread 7 name:
Thread 7:
0   libsystem_kernel.dylib          0x000000024aca25c8 mach_msg2_trap + 8 (:-1)
1   libsystem_kernel.dylib          0x000000024acaa6b4 mach_msg2_internal + 80 (mach_msg.c:201)
2   libsystem_kernel.dylib          0x000000024acaa948 mach_msg_overwrite + 436 (mach_msg.c:0)
3   libsystem_kernel.dylib          0x000000024acaa788 mach_msg + 24 (mach_msg.c:323)
4   CoreFoundation                  0x00000001a604c988 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2624)
5   CoreFoundation                  0x00000001a6046c40 __CFRunLoopRun + 1208 (CFRunLoop.c:3007)
6   CoreFoundation                  0x00000001a6046364 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
7   Foundation                      0x00000001aa4622ac -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373)
8   Foundation                      0x00000001aa4624dc -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420)
9   UIKitCore                       0x00000002328399e0 -[UIEventFetcher threadMain] + 420 (UIEventFetcher.m:1207)
10  Foundation                      0x00000001aa487eb4 __NSThread__start__ + 716 (NSThread.m:991)
11  libsystem_pthread.dylib         0x000000024ad7f48c _pthread_start + 116 (pthread.c:931)
12  libsystem_pthread.dylib         0x000000024ad885ac thread_start + 8 (:-1)

Thread 8 name:
Thread 8:
0   libsystem_kernel.dylib          0x000000024aca46d0 __select + 8
1   CoreFoundation                  0x00000001a605c348 __CFSocketManager + 640 (CFSocket.c:1340)
2   libsystem_pthread.dylib         0x000000024ad7f48c _pthread_start + 116 (pthread.c:931)
3   libsystem_pthread.dylib         0x000000024ad885ac thread_start + 8 (:-1)

Thread 9 name:
Thread 9:
0   libsystem_kernel.dylib          0x000000024aca2544 semaphore_wait_trap + 8 (:-1)
1   caulk                           0x00000002402c0c5c caulk::semaphore::timed_wait(double) + 212 (semaphore.cpp:98)
2   caulk                           0x00000002402c7f98 caulk::concurrent::details::worker_thread::run() + 36 (messenger.cpp:234)
3   caulk                           0x00000002402c7f48 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 76 (thread.h:189)
4   libsystem_pthread.dylib         0x000000024ad7f48c _pthread_start + 116 (pthread.c:931)
5   libsystem_pthread.dylib         0x000000024ad885ac thread_start + 8 (:-1)

Thread 10 name:
Thread 10:
0   libsystem_kernel.dylib          0x000000024aca2544 semaphore_wait_trap + 8 (:-1)
1   caulk                           0x00000002402c0c5c caulk::semaphore::timed_wait(double) + 212 (semaphore.cpp:98)
2   caulk                           0x00000002402c7f98 caulk::concurrent::details::worker_thread::run() + 36 (messenger.cpp:234)
3   caulk                           0x00000002402c7f48 void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*>>>(void*) + 76 (thread.h:189)
4   libsystem_pthread.dylib         0x000000024ad7f48c _pthread_start + 116 (pthread.c:931)
5   libsystem_pthread.dylib         0x000000024ad885ac thread_start + 8 (:-1)

Thread 3 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x000000016d35a7c8   x2: 0x0000000000000000   x3: 0x0000000301cfcc40
    x4: 0x00000003022382c0   x5: 0x000000016d35a4b0   x6: 0x0000000000000035   x7: 0xffffffff00001900
    x8: 0xef4ebd3686510004   x9: 0x0000000000002603  x10: 0x000000000007897c  x11: 0x0000000000000007
   x12: 0x00000001045e61d0  x13: 0x0000000000000000  x14: 0x0000000000000000  x15: 0xffffffffffffffff
   x16: 0x00000001b4d1b44c  x17: 0x0000000102ce06d8  x18: 0x0000000000000000  x19: 0x000000016d35a838
   x20: 0x0000000302243090  x21: 0x0000000000000000  x22: 0x0000000208ebd378  x23: 0x0000000000000001
   x24: 0x00000003027410e8  x25: 0x0000000000000000  x26: 0x0000000000000000  x27: 0x0000000301c58d40
   x28: 0x0000000000000000   fp: 0x000000016d35a7b0   lr: 0x6d0c0a0102ce06f4
    sp: 0x000000016d35a7b0   pc: 0x00000001b4d1b458 cpsr: 0x40001000
   esr: 0x92000006 (Data Abort) byte read Translation fault

Binary Images:
        0x102cd0000 -         0x102e4bfff Moonlight Vision arm64  <0631fe12d3513f19969a4adab82cf869> /private/var/containers/Bundle/Application/9F08D7E2-E1C2-4512-B240-71D93BE4EF8D/Moonlight Vision.app/Moonlight Vision
        0x10316c000 -         0x103177fff libobjc-trampolines.dylib arm64e  <a019488b092632f9bda36e4a9a8d8107> /usr/lib/libobjc-trampolines.dylib
        0x10340c000 -         0x103697fff OpenSSL arm64  <67345a1c77d2398790864bc333220bb8> /private/var/containers/Bundle/Application/9F08D7E2-E1C2-4512-B240-71D93BE4EF8D/Moonlight Vision.app/Frameworks/OpenSSL.framework/OpenSSL
        0x1a4064000 -         0x1a443bfff CFNetwork arm64e  <96353d02340a372bb764981869ba71f9> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
        0x1a5fc4000 -         0x1a64effff CoreFoundation arm64e  <1ee299eb1c3b3739af62ade824383ae1> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
        0x1a9da4000 -         0x1aa8fbfff Foundation arm64e  <a6a803e29ba13fda8bf549b77376b91a> /System/Library/Frameworks/Foundation.framework/Foundation
        0x1b4c54000 -         0x1b4e0ffff Security arm64e  <44c29e4865363e6eb51ccdd1314ffd5c> /System/Library/Frameworks/Security.framework/Security
        0x1b5858000 -         0x1b7813fff SwiftUI arm64e  <3eb426f6e6ed3b318596ea5b9f592d95> /System/Library/Frameworks/SwiftUI.framework/SwiftUI
        0x1e1d30000 -         0x1e1d3bfff GraphicsServices arm64e  <5ecc7a1c0cef3b72b07beec11e2361cf> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
        0x231abc000 -         0x2335affff UIKitCore arm64e  <757dbfd444b839ec89c4678069d10f96> /System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore
        0x2402ac000 -         0x2402d7fff caulk arm64e  <0ad188fb9cf631afb5771ad19ce98b43> /System/Library/PrivateFrameworks/caulk.framework/caulk
        0x243c48000 -         0x243ccac6b dyld arm64e  <3ff5382b0f313e63b4db1833148359a9> /usr/lib/dyld
        0x24aaf6000 -         0x24ab3dfff libdispatch.dylib arm64e  <9d7b7ba9a33e3a0f8fd375b9d9f2791d> /usr/lib/system/libdispatch.dylib
        0x24ab96000 -         0x24ac15fff libsystem_c.dylib arm64e  <13c14088cfb635d09e77b857a0cc7b1e> /usr/lib/system/libsystem_c.dylib
        0x24ac9e000 -         0x24acd9fe3 libsystem_kernel.dylib arm64e  <370292e8618435819c811d13a322b93b> /usr/lib/system/libsystem_kernel.dylib
        0x24ad7e000 -         0x24ad89fff libsystem_pthread.dylib arm64e  <0329adf7b37f3b9e9fa2022890c9e4c2> /usr/lib/system/libsystem_pthread.dylib

EOF
goast-ai[bot] commented 2 months ago

NEW FEATURES

alexhaugland commented 2 months ago

@goast-ai it looks like there's some stray markdown syntax in the code that will prevent it from compiling, please fix.

goast-ai[bot] commented 2 months ago

Got it! I'll start working on that now.

alexhaugland commented 2 months ago

@goast-ai I believe this code will still fail to compile. Please fix it.

goast-ai[bot] commented 2 months ago

Got it! I'll start working on that now.