Rakashazi / emu-ex-plus-alpha

Multi-platform computer & game console emulation system including supporting code (EmuFramework) and core engine (Imagine)
GNU General Public License v3.0
600 stars 145 forks source link

[iOS] [C64.emu] crashes on startup #111

Closed ck16 closed 2 years ago

ck16 commented 6 years ago

Hi @Rakashazi,

I edited line 579 of imagine/src/base/iphone/iPhone.mm as suggested and managed to compile the emulator.

When I start the emulator I get a black screen, then it quits after 1 or 2 seconds.

I tried on an iPhone 7 Plus, iPhone X and iPad Pro 12.9" and get the same result on all 3 devices.

Also is there any plan to support the newer screen modes on iOS devices and to fix the rotation bug of the UI?

Thanks heaps!

Cheers, ck16

ck16 commented 6 years ago

I forgot to add that all the other emulators run fine.

Rakashazi commented 6 years ago

It's probably related to the dynamic library loading so I'll have to do some further testing. As for the updated screen modes I'll look into those as well.

ck16 commented 5 years ago

Hi @Rakashazi,

I just tried the latest version of the code and noticed C64.emu still quits straight after launching. Not sure if you managed to look into the dynamic library loading or not.

Thanks heaps for your help!

Cheers, ck16

yoshisuga commented 5 years ago

Here's an excerpt of my crash log:

Incident Identifier: 4362C660-85F2-4EAA-ADEF-4E4DA04F8EA5
CrashReporter Key:   48d1464da8706e419be60f8b7b768b9676a17d2d
Hardware Model:      iPhone11,6
Process:             c64emu [1683]
Path:                /private/var/containers/Bundle/Application/D7096B33-E497-4849-A6D4-9B949D26AB6B/C64Emu.app/c64emu
Identifier:          com.yoshisuga.C64Emu
Version:             2 (1.5.38)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.yoshisuga.C64Emu [1414]

Date/Time:           2018-12-05 07:44:19.1785 -1000
Launch Time:         2018-12-05 07:44:19.0544 -1000
OS Version:          iPhone OS 12.1 (16B92)
Baseband Version:    1.01.30
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4297932800
      REGION TYPE                      START - END             [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                 00000001002d4000-0000000100380000 [  688K] r-x/r-x SM=COW  ...mu.app/c64emu

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [1683]
Triggered by Thread:  6

Thread 0:
0   libsystem_kernel.dylib          0x000000022be2f17c __exit + 8
1   c64emu                          0x00000001003493e8 0x1002d4000 + 480232
2   UIKitCore                       0x0000000259e32aec -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3380
3   UIKitCore                       0x0000000259e387e4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1568
4   UIKitCore                       0x00000002596a0138 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 808
5   UIKitCore                       0x00000002596a92a0 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 168
6   UIKitCore                       0x000000025969fd98 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 252
7   UIKitCore                       0x00000002596a077c -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1080
8   UIKitCore                       0x000000025969e730 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 776
9   UIKitCore                       0x000000025969e3d8 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 460
10  UIKitCore                       0x00000002596a3828 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 224
11  UIKitCore                       0x00000002596a4818 _performActionsWithDelayForTransitionContext + 120
12  UIKitCore                       0x00000002596a36dc -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 260
13  UIKitCore                       0x00000002596a88e8 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 372
14  UIKitCore                       0x0000000259e36c14 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 556
15  UIKitCore                       0x0000000259a044c8 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 376
16  FrontBoardServices              0x000000022ed29798 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 456
17  FrontBoardServices              0x000000022ed350e8 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 284
18  FrontBoardServices              0x000000022ed34708 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 72
19  libdispatch.dylib               0x000000022bca92f0 _dispatch_client_callout + 20
20  libdispatch.dylib               0x000000022bcac8b4 _dispatch_block_invoke_direct + 240
21  FrontBoardServices              0x000000022ed6bb08 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48
22  FrontBoardServices              0x000000022ed6b774 -[FBSSerialQueue _performNext] + 448
23  FrontBoardServices              0x000000022ed6bde0 -[FBSSerialQueue _performNextFromRunLoopSource] + 60
24  CoreFoundation                  0x000000022c2316a0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
25  CoreFoundation                  0x000000022c23161c __CFRunLoopDoSource0 + 92
26  CoreFoundation                  0x000000022c230ed4 __CFRunLoopDoSources0 + 180
27  CoreFoundation                  0x000000022c22bbb4 __CFRunLoopRun + 1032
28  CoreFoundation                  0x000000022c22b494 CFRunLoopRunSpecific + 452
29  GraphicsServices                0x000000022e4debe8 GSEventRunModal + 104
30  UIKitCore                       0x0000000259e3a68c UIApplicationMain + 216
31  c64emu                          0x0000000100349850 0x1002d4000 + 481360

Thread 1:
0   libsystem_pthread.dylib         0x000000022beaedd0 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib         0x000000022beaedd0 start_wqthread + 0

Thread 3:
0   libsystem_pthread.dylib         0x000000022beaedd0 start_wqthread + 0

Thread 4 name:  com.apple.uikit.eventfetch-thread
Thread 4:
0   libsystem_kernel.dylib          0x000000022be24a68 mach_msg_trap + 8
1   CoreFoundation                  0x000000022c23106c __CFRunLoopServiceMachPort + 240
2   CoreFoundation                  0x000000022c22bd08 __CFRunLoopRun + 1372
3   CoreFoundation                  0x000000022c22b494 CFRunLoopRunSpecific + 452
4   Foundation                      0x000000022cc2f350 -[NSRunLoop+ 33616 (NSRunLoop) runMode:beforeDate:] + 304
5   Foundation                      0x000000022cc2f1f4 -[NSRunLoop+ 33268 (NSRunLoop) runUntilDate:] + 152
6   UIKitCore                       0x0000000259f2e798 -[UIEventFetcher threadMain] + 140
7   Foundation                      0x000000022cc2df30 -[NSThread main] + 72
8   Foundation                      0x000000022cd6abb4 __NSThread__start__ + 1044
9   libsystem_pthread.dylib         0x000000022bea69c8 _pthread_body + 132
10  libsystem_pthread.dylib         0x000000022bea6924 _pthread_start + 52
11  libsystem_pthread.dylib         0x000000022beaeddc thread_start + 4

Thread 5:
0   libsystem_pthread.dylib         0x000000022beaedd0 start_wqthread + 0

Thread 6 Crashed:
0   ???                             000000000000000000 0 + 0
1   libsystem_pthread.dylib         0x000000022bea6924 _pthread_start + 52
2   libsystem_pthread.dylib         0x000000022beaeddc thread_start + 4

Thread 6 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000025   x1: 0x0000000000000000   x2: 0x00000001002dd674   x3: 0x000000016fb28e10
    x4: 0x000000016fe6f000   x5: 0x00000000190008ff   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000000   x9: 0x0000000000006704  x10: 0x000000000000129c  x11: 0x0000000268597804
   x12: 0x0000000268597804  x13: 0x0000000000000005  x14: 0x0000000000000001  x15: 0x0000000000000881
   x16: 0xffffffffffffffdc  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x000000016fe6f000
   x20: 0x0000000000000000  x21: 0x0000000000000000  x22: 0x0000000000000000  x23: 0x0000000000000000
   x24: 0x0000000000000000  x25: 0x0000000000000000  x26: 0x0000000000000000  x27: 0x0000000000000000
   x28: 0x0000000000000000   fp: 0x000000016fe6ef50   lr: 0x00000001002dd694
    sp: 0x000000016fe6ef30   pc: 0x
ck16 commented 5 years ago

Hi @Rakashazi / @yoshisuga,

Did either of you manage to find the cause of the C64.emu app crashing on startup?

Cheers, ck16

yoshisuga commented 5 years ago

I haven’t had the chance to trace the root of the cause - it’s hard to track down for me because of my unfamiliarity with the development environment and dealing with precompiled sources. I can hit a breakpoint in Xcode, for example, but I wouldn’t be able to tell where in the core source the error occurred

ck16 commented 4 years ago

Hi @Rakashazi / @yoshisuga,

Was there any update to this issue?

Cheers, ck16

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.