Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reboot broken for Turbo-R #6

Open
0xe1f opened this issue Aug 25, 2013 · 4 comments
Open

Reboot broken for Turbo-R #6

0xe1f opened this issue Aug 25, 2013 · 4 comments

Comments

@0xe1f
Copy link
Member

0xe1f commented Aug 25, 2013

Users reported inability to restart: http://www.msx.org/forum/msx-talk/emulation/cocoamsx-13

Machine: Panasonic FS-A1ST (Turbo-R)

@ghost ghost assigned 0xe1f Aug 25, 2013
@0xe1f
Copy link
Member Author

0xe1f commented Aug 27, 2013

To reproduce: wait until the logo animation completes, then reboot. Issue isn't isolated to Snow Leopard (reproduced on 10.8.4).

@0xe1f
Copy link
Member Author

0xe1f commented Sep 10, 2013

The bug is also present in blueMSX 2.8.2 (related to emulation core)

0xe1f added a commit that referenced this issue Oct 16, 2013
dialogs (Issue #7 fix)
Added a Hard Reset option to the MSX menu, activated by holding down
Option while the MSX menu is active (Issue #6 workaround)
@0xe1f
Copy link
Member Author

0xe1f commented Oct 16, 2013

Until there's a proper fix for this issue, commit 03f521b adds an option to perform a hard reset, which can be done by pressing Option+Command+R (or holding down Option while the MSX menu is open).

@0xe1f
Copy link
Member Author

0xe1f commented Sep 15, 2015

I'm now observing this in other systems (e.g. MSX2 Yamaha YIS), and upon emulator shutdown. Emulator hangs, because pthread_join and semaphore_wait are causing a deadlock.

Relevant threads:

  thread #1: tid = 0x41d784, 0x00007fff98aa748a libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
    frame #0: 0x00007fff98aa748a libsystem_kernel.dylib`__semwait_signal + 10
    frame #1: 0x00007fff9925d01d libsystem_pthread.dylib`pthread_join + 445
    frame #2: 0x000000010019b76b CocoaMSX`-[CMThread join](self=0x00006100014b3e60, _cmd=0x00007fff918dfbab) + 43 at CMThread.m:79
    frame #3: 0x000000010019b84f CocoaMSX`archThreadJoin(thread=0x00006100014b3e60, timeout=3000) + 31 at CMThread.m:112
    frame #4: 0x000000010001ef2f CocoaMSX`emulatorStop + 127 at Emulator.c:523
    frame #5: 0x000000010018310a CocoaMSX`-[CMEmulatorController stop](self=0x0000000100d01de0, _cmd=0x00007fff8f08d1cf) + 106 at CMEmulatorController.m:628
    frame #6: 0x000000010018e7ba CocoaMSX`-[CMEmulatorController windowWillClose:](self=0x0000000100d01de0, _cmd=0x00007fff92c1e82f, notification=0x0000608000041b60) + 42 at CMEmulatorController.m:2911
    frame #7: 0x00007fff8e30845c CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
    frame #8: 0x00007fff8e1f8634 CoreFoundation`_CFXNotificationPost + 3140
    frame #9: 0x00007fff9bb0daa1 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 66
    frame #10: 0x00007fff924f8b94 AppKit`__18-[NSWindow _close]_block_invoke + 182
    frame #11: 0x00007fff924f8a96 AppKit`-[NSWindow _close] + 376
    frame #12: 0x00007fff925cb106 AppKit`-[NSWindow _closeForTermination] + 96
    frame #13: 0x00007fff8e27dd80 CoreFoundation`-[NSArray makeObjectsPerformSelector:] + 496
    frame #14: 0x00007fff925caf00 AppKit`-[NSApplication _deallocHardCore:] + 331
    frame #15: 0x00007fff925c7a17 AppKit`-[NSApplication terminate:] + 1943
    frame #16: 0x00007fff926b02ff AppKit`-[NSApplication _terminateFromSender:askIfShouldTerminate:saveWindows:] + 240
    frame #17: 0x00007fff926b017e AppKit`__52-[NSApplication(NSAppleEventHandling) _handleAEQuit]_block_invoke + 46
    frame #18: 0x00007fff8e2688ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    frame #19: 0x00007fff8e25a9f5 CoreFoundation`__CFRunLoopDoBlocks + 341
    frame #20: 0x00007fff8e25a1ae CoreFoundation`__CFRunLoopRun + 910
    frame #21: 0x00007fff8e259bd8 CoreFoundation`CFRunLoopRunSpecific + 296
    frame #22: 0x00007fff97bb056f HIToolbox`RunCurrentEventLoopInMode + 235
    frame #23: 0x00007fff97bb01ee HIToolbox`ReceiveNextEventCommon + 179
    frame #24: 0x00007fff97bb012b HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #25: 0x00007fff922d88ab AppKit`_DPSNextEvent + 978
    frame #26: 0x00007fff922d7e58 AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
    frame #27: 0x00007fff922cdaf3 AppKit`-[NSApplication run] + 594
    frame #28: 0x00007fff9224a244 AppKit`NSApplicationMain + 1832
    frame #29: 0x0000000100170f62 CocoaMSX`main(argc=3, argv=0x00007fff5fbff748) + 34 at main.m:27
    frame #30: 0x0000000100001a44 CocoaMSX`start + 52

* thread #15: tid = 0x41d7d8, 0x00007fff98aa251a libsystem_kernel.dylib`semaphore_wait_trap + 10
  * frame #0: 0x00007fff98aa251a libsystem_kernel.dylib`semaphore_wait_trap + 10
    frame #1: 0x000000010003587a CocoaMSX`archSemaphoreWait(semaphore=0x0000610000c0d610, timeout=-1) + 26 at CocoaSema.c:57
    frame #2: 0x00000001000a91f6 CocoaMSX`archEventWait(event=0x00006100002266e0, timeout=-1) + 38 at CocoaEvent.c:68
    frame #3: 0x000000010001f8c2 CocoaMSX`WaitForSync(maxSpeed=0, breakpointHit=0) + 562 at Emulator.c:795
    frame #4: 0x0000000100006107 CocoaMSX`doSync(time=275600539, breakpointHit=0) + 55 at Board.c:523
    frame #5: 0x0000000100007a2b CocoaMSX`onSync(ref=0x0000618000244bc0, time=275600539) + 27 at Board.c:570
    frame #6: 0x0000000100008470 CocoaMSX`boardTimerCheckTimeout(dummy=0x0000000000000000) + 192 at Board.c:1416
    frame #7: 0x000000010014f1ad CocoaMSX`r800Execute(r800=0x000000010207c000) + 221 at R800.c:6043
    frame #8: 0x000000010000757d CocoaMSX`boardRun(machine=0x0000000102065e00, deviceInfo=0x0000000100478080, mixer=0x000000010203a600, stateFile=0x0000000000000000, frequency=3579545, reversePeriod=50, reverseBufferCnt=300, syncCallback=0x000000010001f690) + 1213 at Board.c:803
    frame #9: 0x000000010001f642 CocoaMSX`emulatorThread + 290 at Emulator.c:392
    frame #10: 0x000000010019b71a CocoaMSX`pThreadCallback(data=0x0000610000c0d630) + 74 at CMThread.m:93
    frame #11: 0x00007fff9925c05a libsystem_pthread.dylib`_pthread_body + 131
    frame #12: 0x00007fff9925bfd7 libsystem_pthread.dylib`_pthread_start + 176
    frame #13: 0x00007fff992593ed libsystem_pthread.dylib`thread_start + 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant