mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
393 stars 113 forks source link

Crash on macOS 13/M1 when entering fullscreen mode #731

Open agatti opened 1 year ago

agatti commented 1 year ago

As per subject, Attract crashes when switching to fullscreen mode on macOS 13.0 on Apple Silicon. This happens on the v2.6.1 binary release downloaded from the website. Since this is an x86 executable I'm not sure if it's the emulation layer's fault, but I couldn't find any pre-built Arm versions. I'll see if I can build my own version to see if this still happens.

Steps to reproduce:

Launching attract from the command line with --loglevel debug says it cannot find a valid video mode ("The requested video mode is not available, switching to a valid mode") before crashing, with no further output.

The relevant bits of the stack trace are as follows:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsfml-window.2.5.1.dylib             0x1092a1a6c sf::Window::create(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) + 344
1   attract                                0x1006b5b5d 0x100626000 + 588637
2   attract                                0x100715b0d 0x100626000 + 981773
3   dyld                                   0x200a10310 start + 2432

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                             0x7ff7fffa9750 0x7ff7fffa5000 + 18256
1   runtime                             0x7ff7fffb566c 0x7ff7fffa5000 + 67180
2   runtime                             0x7ff7fffb706c 0x7ff7fffa5000 + 73836

Thread 2:
0   runtime                             0x7ff7fffc787c 0x7ff7fffa5000 + 141436

Thread 3:
0   runtime                             0x7ff7fffc78b0 0x7ff7fffa5000 + 141488

Thread 4:
0   runtime                             0x7ff7fffc787c 0x7ff7fffa5000 + 141436

Thread 5:: caulk.messenger.shared:17
0   ???                                 0x7ff8ac0b69a8 ???
1   libsystem_kernel.dylib              0x7ff81cdf061e semaphore_wait_trap + 10
2   caulk                               0x7ff826a7c8f8 caulk::mach::semaphore::wait_or_error() + 16
3   caulk                               0x7ff826a62664 caulk::concurrent::details::worker_thread::run() + 36
4   caulk                               0x7ff826a62328 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*) + 41
5   libsystem_pthread.dylib             0x7ff81ce2f259 _pthread_start + 125
6   libsystem_pthread.dylib             0x7ff81ce2ac7b thread_start + 15

Thread 6:: com.apple.audio.IOThread.client
0   ???                                 0x7ff8ac0b69a8 ???
1   libsystem_kernel.dylib              0x7ff81cdf06a2 mach_msg2_trap + 10
2   libsystem_kernel.dylib              0x7ff81cdfe67d mach_msg2_internal + 82
3   libsystem_kernel.dylib              0x7ff81cdf771a mach_msg_overwrite + 723
4   libsystem_kernel.dylib              0x7ff81cdf0989 mach_msg + 19
5   CoreAudio                           0x7ff81f0778a5 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 111
6   CoreAudio                           0x7ff81ef504c1 HALC_ProxyIOContext::IOWorkLoop() + 3783
7   CoreAudio                           0x7ff81ef4f029 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 63
8   CoreAudio                           0x7ff81f0d6630 HALB_IOThread::Entry(void*) + 72
9   libsystem_pthread.dylib             0x7ff81ce2f259 _pthread_start + 125
10  libsystem_pthread.dylib             0x7ff81ce2ac7b thread_start + 15

Thread 7:
0   runtime                             0x7ff7fffc787c 0x7ff7fffa5000 + 141436

Thread 8:
0   runtime                             0x7ff7fffc787c 0x7ff7fffa5000 + 141436

Thread 9:: com.apple.NSEventThread
0   ???                                 0x7ff8ac0b69a8 ???
1   libsystem_kernel.dylib              0x7ff81cdf06a2 mach_msg2_trap + 10
2   libsystem_kernel.dylib              0x7ff81cdfe67d mach_msg2_internal + 82
3   libsystem_kernel.dylib              0x7ff81cdf771a mach_msg_overwrite + 723
4   libsystem_kernel.dylib              0x7ff81cdf0989 mach_msg + 19
5   CoreFoundation                      0x7ff81cf0a02b __CFRunLoopServiceMachPort + 145
6   CoreFoundation                      0x7ff81cf08a84 __CFRunLoopRun + 1387
7   CoreFoundation                      0x7ff81cf07e9f CFRunLoopRunSpecific + 560
8   AppKit                              0x7ff8200c5696 _NSEventThread + 132
9   libsystem_pthread.dylib             0x7ff81ce2f259 _pthread_start + 125
10  libsystem_pthread.dylib             0x7ff81ce2ac7b thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x00000003051265d0  rcx: 0x00000001092a10f0  rdx: 0x0000000305126530
  rdi: 0x0000000000000000  rsi: 0x0000000000000000  rbp: 0x00000003051265b0  rsp: 0x0000000305126560
   r8: 0x0000000000000000   r9: 0x0000000000000154  r10: 0x00000000000003c0  r11: 0x00006000033879fc
  r12: 0x0000000000000008  r13: 0x0000000109176470  r14: 0x0000000305126658  r15: 0x000000000000000a
  rip: <unavailable>       rfl: 0x0000000000000202
 tmp0: 0x00000001092a1a69 tmp1: 0x00000001092a1a69 tmp2: 0x00000001092d536c

Binary Images:
       0x109299000 -        0x1092b5fff libsfml-window.2.5.1.dylib (*) <ab2547ef-e63b-3876-aada-63fd43d9a750> /Applications/Attract.app/Contents/libs/libsfml-window.2.5.1.dylib
       0x100626000 -        0x100836fff attract (*) <defd862f-951b-3912-a103-09a286bf0cbe> /Applications/Attract.app/Contents/MacOS/attract
       0x200a0a000 -        0x200aa1fff dyld (*) <0f050705-2258-3d40-b7bc-f3b35a44bbea> /usr/lib/dyld
    0x7ff7fffa5000 -     0x7ff7fffd4fff runtime (*) <6f797d84-b330-3656-9a0d-7b3dbd3f8a07> /usr/libexec/rosetta/runtime
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
    0x7ff81cdef000 -     0x7ff81ce28ff7 libsystem_kernel.dylib (*) <0c2fd2c9-777c-3355-b70f-7b1b6e9d1b0b> /usr/lib/system/libsystem_kernel.dylib
    0x7ff826a60000 -     0x7ff826a85fff com.apple.audio.caulk (1.0) <43ed8c13-59df-3c8d-b4d2-aee44e4939b9> /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk
    0x7ff81ce29000 -     0x7ff81ce34ff7 libsystem_pthread.dylib (*) <13b5e252-77d1-31e1-888d-1c5f4426ea87> /usr/lib/system/libsystem_pthread.dylib
    0x7ff81ed78000 -     0x7ff81f472ffd com.apple.audio.CoreAudio (5.0) <e9f27094-01cb-337a-8530-0cab0e2cc96d> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x7ff81ce8b000 -     0x7ff81d322fff com.apple.CoreFoundation (6.9) <bca7763f-086a-3837-b278-2f8046e4e885> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7ff81ff27000 -     0x7ff820f2bff6 com.apple.AppKit (6.9) <817d572e-eb8c-3999-b7a0-68e1c4b47266> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit