diasurgical / devilutionX

Diablo build for modern operating systems
Other
7.94k stars 775 forks source link

Crash when switching rendering resolutions sometimes #6387

Open LupusEtFlos opened 1 year ago

LupusEtFlos commented 1 year ago

Operating System

PlayStation 4

DevilutionX version

1.5.0 (latest release)

Describe

SDL crash message when trying out resolution modes and other graphic options.

To Reproduce

Go to settings>graphics>attempt to change resolution while also changing "fit to screen" and "upscale".

Expected Behavior

Properly changing the resolution

Additional context

No response

qndel commented 1 year ago

and what's the crash message?

ndlanier commented 1 year ago

I've had this issue as well.

No crash message presented via gui. Just hangs and gets a sigterm. Namespace SIGNAL, Code 8 Floating point exception: 8

Happend on the x86_64 release build and a locally created arm build.

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               devilutionx [77334]
Path:                  /Applications/devilutionx_x86.app/Contents/MacOS/devilutionx
Identifier:            com.diasurgical.devilutionx
Version:               1.5.0 (1.5.0)
Code Type:             X86-64 (Translated)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2023-07-18 22:16:51.8653 -0500
OS Version:            macOS 13.4.1 (22F82)
Report Version:        12
Anonymous UUID:        EF22B875-F489-4FD1-90D7-BCAA64B037C2

Sleep/Wake UUID:       D2A35D05-94F3-4B70-B125-9CD11C0AEB5A

Time Awake Since Boot: 160000 seconds
Time Since Wake:       2115 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_ARITHMETIC (SIGFPE)
Exception Codes:       0x0000000000000001, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 8 Floating point exception: 8
Terminating Process:   exc handler [77334]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   devilutionx                            0x104b12745 0x10490e000 + 2115397
1   devilutionx                            0x104b12ee4 0x10490e000 + 2117348
2   devilutionx                            0x104a7476a 0x10490e000 + 1468266
3   devilutionx                            0x104a73906 0x10490e000 + 1464582
4   devilutionx                            0x104a5992a 0x10490e000 + 1358122
5   devilutionx                            0x104a594c8 0x10490e000 + 1357000
6   devilutionx                            0x104a5b638 0x10490e000 + 1365560
7   devilutionx                            0x104a7232b 0x10490e000 + 1458987
8   devilutionx                            0x10499e58d 0x10490e000 + 591245
9   devilutionx                            0x10493dd84 0x10490e000 + 195972
10  dyld                                   0x20502841f start + 1903

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                             0x7ff7ffecd694 0x7ff7ffec9000 + 18068

Thread 2:
0   runtime                             0x7ff7ffeeb87c 0x7ff7ffec9000 + 141436

Thread 3:
0   runtime                             0x7ff7ffeeb87c 0x7ff7ffec9000 + 141436

Thread 4:
0   runtime                             0x7ff7ffeeb87c 0x7ff7ffec9000 + 141436

Thread 5:
0   runtime                             0x7ff7ffeeb87c 0x7ff7ffec9000 + 141436

Thread 6:: caulk.messenger.shared:17
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff80607852e semaphore_wait_trap + 10
2   caulk                               0x7ff80fe0b07e caulk::semaphore::timed_wait(double) + 150
3   caulk                               0x7ff80fe0af9c caulk::concurrent::details::worker_thread::run() + 30
4   caulk                               0x7ff80fe0acb0 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             0x7ff8060b71d3 _pthread_start + 125
6   libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 7:
0   runtime                             0x7ff7ffeeb87c 0x7ff7ffec9000 + 141436

Thread 8:: com.apple.NSEventThread
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff8060785b2 mach_msg2_trap + 10
2   libsystem_kernel.dylib              0x7ff80608672d mach_msg2_internal + 78
3   libsystem_kernel.dylib              0x7ff80607f5e4 mach_msg_overwrite + 692
4   libsystem_kernel.dylib              0x7ff80607889a mach_msg + 19
5   CoreFoundation                      0x7ff806192a40 __CFRunLoopServiceMachPort + 145
6   CoreFoundation                      0x7ff8061914cb __CFRunLoopRun + 1365
7   CoreFoundation                      0x7ff80619091c CFRunLoopRunSpecific + 560
8   AppKit                              0x7ff8092e4789 _NSEventThread + 132
9   libsystem_pthread.dylib             0x7ff8060b71d3 _pthread_start + 125
10  libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 9:: AudioQueue thread
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff8060785b2 mach_msg2_trap + 10
2   libsystem_kernel.dylib              0x7ff80608672d mach_msg2_internal + 78
3   libsystem_kernel.dylib              0x7ff80607f5e4 mach_msg_overwrite + 692
4   libsystem_kernel.dylib              0x7ff80607889a mach_msg + 19
5   CoreFoundation                      0x7ff806192a40 __CFRunLoopServiceMachPort + 145
6   CoreFoundation                      0x7ff8061914cb __CFRunLoopRun + 1365
7   CoreFoundation                      0x7ff80619091c CFRunLoopRunSpecific + 560
8   libSDL2-2.0.0.dylib                    0x10ddbf7eb audioqueue_thread + 1087
9   libSDL2-2.0.0.dylib                    0x10dd3ce31 SDL_RunThread + 44
10  libSDL2-2.0.0.dylib                    0x10ddac957 RunThread + 9
11  libsystem_pthread.dylib             0x7ff8060b71d3 _pthread_start + 125
12  libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 10:: caulk.messenger.shared:high
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff80607852e semaphore_wait_trap + 10
2   caulk                               0x7ff80fe0b07e caulk::semaphore::timed_wait(double) + 150
3   caulk                               0x7ff80fe0af9c caulk::concurrent::details::worker_thread::run() + 30
4   caulk                               0x7ff80fe0acb0 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             0x7ff8060b71d3 _pthread_start + 125
6   libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 11:: AQConverterThread
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff80607b0ee __psynch_cvwait + 10
2   libsystem_pthread.dylib             0x7ff8060b7758 _pthread_cond_wait + 1242
3   libAudioToolboxUtility.dylib        0x7ff81528b8c0 CADeprecated::CAGuard::Wait() + 54
4   AudioToolbox                        0x7ff8163cad8f AQConverterManager::AQConverterThread::ConverterThreadEntry(void*) + 729
5   libAudioToolboxUtility.dylib        0x7ff81526c3ab CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*) + 77
6   libsystem_pthread.dylib             0x7ff8060b71d3 _pthread_start + 125
7   libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 12:: com.apple.audio.IOThread.client
0   ???                                 0x7ff895cae9a8 ???
1   libsystem_kernel.dylib              0x7ff8060785b2 mach_msg2_trap + 10
2   libsystem_kernel.dylib              0x7ff80608672d mach_msg2_internal + 78
3   libsystem_kernel.dylib              0x7ff80607f5e4 mach_msg_overwrite + 692
4   libsystem_kernel.dylib              0x7ff80607889a mach_msg + 19
5   CoreAudio                           0x7ff8082c2175 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 111
6   CoreAudio                           0x7ff8081ac6a1 HALC_ProxyIOContext::IOWorkLoop() + 4035
7   CoreAudio                           0x7ff8081ab049 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 80
8   CoreAudio                           0x7ff80831a946 HALB_IOThread::Entry(void*) + 72
9   libsystem_pthread.dylib             0x7ff8060b71d3 _pthread_start + 125
10  libsystem_pthread.dylib             0x7ff8060b2bd3 thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00000000000005be  rbx: 0x0000000000000534  rcx: 0x00000000000003bc  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x00000000000005be  rbp: 0x000000030da2f480  rsp: 0x000000030da2f450
   r8: 0x0000000000000000   r9: 0x0000000000003e00  r10: 0x000000000000801f  r11: 0x0000000000003fff
  r12: 0x0000000104cb89d0  r13: 0x0000600001d19000  r14: 0x0000053400000800  r15: 0x0000000104cd25f0
  rip: <unavailable>       rfl: 0x0000000000200242
 tmp0: 0x0000000000000000 tmp1: 0x00000000000005be tmp2: 0x0000000000000000

Binary Images:
       0x205022000 -        0x2050bdfff dyld (*) <5db85b72-c63a-3182-91e5-5c942ec30e48> /usr/lib/dyld
    0x7ff7ffec9000 -     0x7ff7ffef8fff runtime (*) <c4d322c3-30c5-3c52-adb8-2fd12ec92bc0> /usr/libexec/rosetta/runtime
       0x10d357000 -        0x10d3aafff libRosettaRuntime (*) <c8f25cdc-b334-3f67-bc30-50e9852f8da2> /Library/Apple/*/libRosettaRuntime
       0x10490e000 -        0x104c99fff com.diasurgical.devilutionx (1.5.0) <89974e25-15e4-3073-bc67-9b88e0d4ef7d> /Applications/devilutionx_x86.app/Contents/MacOS/devilutionx
       0x10e0e5000 -        0x10e3c4fff discord_game_sdk.dylib (*) <9a52e534-b1c7-3ffc-9deb-d7d81fdddce0> /Applications/devilutionx_x86.app/Contents/Frameworks/discord_game_sdk.dylib
       0x10d909000 -        0x10d92cfff libpng16.16.dylib (*) <b574b00f-78dc-37d6-a47c-72e0e7494eaf> /Applications/devilutionx_x86.app/Contents/Frameworks/libpng16.16.dylib
       0x10d9d3000 -        0x10da12fff libsodium.23.dylib (*) <ed7c7f70-3373-3f37-b357-10ce9700cc34> /Applications/devilutionx_x86.app/Contents/Frameworks/libsodium.23.dylib
       0x10d97c000 -        0x10d98ffff libfmt.9.1.0.dylib (*) <26c61da9-20ee-3061-8cf0-14267cacc619> /Applications/devilutionx_x86.app/Contents/Frameworks/libfmt.9.1.0.dylib
       0x10dcd7000 -        0x10ddfefff libSDL2-2.0.0.dylib (*) <fa15f4bf-fd1e-37bc-9f2a-2c924ce26015> /Applications/devilutionx_x86.app/Contents/Frameworks/libSDL2-2.0.0.dylib
       0x114051000 -        0x114060fff libobjc-trampolines.dylib (*) <1d043270-56bc-35fb-bef3-b1ba8ecb9120> /usr/lib/libobjc-trampolines.dylib
       0x11be2b000 -        0x11bf6afff com.apple.audio.units.Components (1.14) <1506f5ce-501f-36b7-a132-4a058d8462dd> /System/Library/Components/CoreAudio.component/Contents/MacOS/CoreAudio
       0x11da7a000 -        0x11e3fdfff com.apple.audio.AudioDSPComponents (1.0) <b2ab4808-92a3-3c11-896e-4a477cb9bc58> /System/Library/Components/AudioDSP.component/Contents/MacOS/AudioDSP
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
    0x7ff806077000 -     0x7ff8060b0ff7 libsystem_kernel.dylib (*) <eb4e80a0-99da-32dc-b9ad-394fbb50a0ac> /usr/lib/system/libsystem_kernel.dylib
    0x7ff80fe09000 -     0x7ff80fe2dff3 com.apple.audio.caulk (1.0) <905c3d28-a423-35c6-8a02-c88ba83bc3f6> /System/Library/PrivateFrameworks/caulk.framework/Versions/A/caulk
    0x7ff8060b1000 -     0x7ff8060bcfff libsystem_pthread.dylib (*) <8cb0b396-011f-31f2-8915-94cde1abae84> /usr/lib/system/libsystem_pthread.dylib
    0x7ff806116000 -     0x7ff8065b0fff com.apple.CoreFoundation (6.9) <661e8471-af64-30f9-9ce3-40bdaeeec321> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7ff809146000 -     0x7ff80a14dff8 com.apple.AppKit (6.9) <935dfca1-61f9-377d-895a-99ef90266c86> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    0x7ff815260000 -     0x7ff815291fe7 libAudioToolboxUtility.dylib (*) <1b6c354b-02fe-36f7-84f2-edb3cf5bf565> /usr/lib/libAudioToolboxUtility.dylib
    0x7ff816399000 -     0x7ff8164bbffb com.apple.audio.toolbox.AudioToolbox (1.14) <e63118c9-2f09-38e6-89bb-5f8ebc7e3619> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7ff807fd3000 -     0x7ff808684ff6 com.apple.audio.CoreAudio (5.0) <61b97c10-5b99-3184-b5b8-48f90b6eabc3> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=646.0M resident=0K(0%) swapped_out_or_unallocated=646.0M(100%)
Writable regions: Total=1.8G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.8G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Accelerate framework               128K        1 
Activity Tracing                   256K        1 
CG backing stores                 3328K        4 
CG image                            60K        7 
ColorSync                          236K       25 
CoreAnimation                       76K       11 
CoreGraphics                        12K        2 
CoreGraphics (reserved)              8K        1         reserved VM address space (unallocated)
CoreUI image data                 1028K        7 
Foundation                          36K        2 
Image IO                             4K        1 
Kernel Alloc Once                    8K        1 
MALLOC                           298.3M       61 
MALLOC guard page                  192K        9 
MALLOC_MEDIUM (reserved)         952.0M        8         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
Rosetta Arena                     4096K        2 
Rosetta Generic                   1128K      279 
Rosetta IndirectBranch            1024K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack               220K       22 
Rosetta Thread Context             220K       22 
STACK GUARD                         20K        5 
Stack                             13.6M       12 
Stack Guard                       56.0M        7 
VM_ALLOCATE                       3048K       38 
VM_ALLOCATE (reserved)              44K        4         reserved VM address space (unallocated)
__CTF                               824        1 
__DATA                            23.9M      505 
__DATA_CONST                      30.2M      327 
__DATA_DIRTY                      1392K      174 
__FONT_DATA                        2352        1 
__INFO_FILTER                         8        1 
__LINKEDIT                       173.5M       16 
__OBJC_RO                         66.3M        1 
__OBJC_RW                         2010K        2 
__TEXT                           472.5M      529 
dyld private memory                260K        2 
mapped file                        4.4G     1326 
shared memory                     1336K       19 
unshared pmap                     13.4M       10 
===========                     =======  ======= 
TOTAL                              7.0G     3449 
TOTAL, minus reserved VM space     5.7G     3449 

-----------
Full Report
-----------

{"app_name":"devilutionx","timestamp":"2023-07-18 22:16:53.00 -0500","app_version":"1.5.0","slice_uuid":"89974e25-15e4-3073-bc67-9b88e0d4ef7d","build_version":"1.5.0","platform":1,"bundleID":"com.diasurgical.devilutionx","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 13.4.1 (22F82)","roots_installed":0,"name":"devilutionx","incident_id":"37339321-91EB-4245-9C7D-B7D57C38B232"}
{
  "uptime" : 160000,
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,2",
  "coalitionID" : 19643,
  "osVersion" : {
    "train" : "macOS 13.4.1",
    "build" : "22F82",
    "releaseType" : "User"
  },
  "captureTime" : "2023-07-18 22:16:51.8653 -0500",
  "incident" : "37339321-91EB-4245-9C7D-B7D57C38B232",
  "pid" : 77334,
  "translated" : true,
  "cpuType" : "X86-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2023-07-18 22:16:25.7342 -0500",
  "procStartAbsTime" : 3972329530699,
  "procExitAbsTime" : 3972956292916,
  "procName" : "devilutionx",
  "procPath" : "\/Applications\/devilutionx_x86.app\/Contents\/MacOS\/devilutionx",
  "bundleInfo" : {"CFBundleShortVersionString":"1.5.0","CFBundleVersion":"1.5.0","CFBundleIdentifier":"com.diasurgical.devilutionx"},
  "storeInfo" : {"deviceIdentifierForVendor":"4059C828-6D8C-5B00-B70B-7BDFC8F24B36","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "com.diasurgical.devilutionx",
  "crashReporterKey" : "EF22B875-F489-4FD1-90D7-BCAA64B037C2",
  "codeSigningID" : "",
  "codeSigningTeamID" : "",
  "codeSigningValidationCategory" : 0,
  "codeSigningTrustLevel" : 0,
  "wakeTime" : 2115,
  "sleepWakeUUID" : "D2A35D05-94F3-4B70-B125-9CD11C0AEB5A",
  "sip" : "enabled",
  "exception" : {"codes":"0x0000000000000001, 0x0000000000000000","rawCodes":[1,0],"type":"EXC_ARITHMETIC","signal":"SIGFPE"},
  "termination" : {"flags":0,"code":8,"namespace":"SIGNAL","indicator":"Floating point exception: 8","byProc":"exc handler","byPid":77334},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":2903506,"threadState":{"flavor":"x86_THREAD_STATE","rbp":{"value":13113685120},"r12":{"value":4375415248},"rosetta":{"tmp2":{"value":0},"tmp1":{"value":1470},"tmp0":{"value":0}},"rbx":{"value":1332},"r8":{"value":0},"r15":{"value":4375520752},"r10":{"value":32799},"rdx":{"value":0},"rdi":{"value":0},"r9":{"value":15872},"r13":{"value":105553146777600},"rflags":{"value":2097730},"rax":{"value":1470},"rsp":{"value":13113685072},"r11":{"value":16383},"rcx":{"value":956},"r14":{"value":5720896440320},"rsi":{"value":1470}},"queue":"com.apple.main-thread","frames":[{"imageOffset":2115397,"imageIndex":3},{"imageOffset":2117348,"imageIndex":3},{"imageOffset":1468266,"imageIndex":3},{"imageOffset":1464582,"imageIndex":3},{"imageOffset":1358122,"imageIndex":3},{"imageOffset":1357000,"imageIndex":3},{"imageOffset":1365560,"imageIndex":3},{"imageOffset":1458987,"imageIndex":3},{"imageOffset":591245,"imageIndex":3},{"imageOffset":195972,"imageIndex":3},{"imageOffset":25631,"symbol":"start","symbolLocation":1903,"imageIndex":0}]},{"id":2903510,"name":"com.apple.rosetta.exceptionserver","frames":[{"imageOffset":18068,"imageIndex":1}]},{"id":2903518,"frames":[{"imageOffset":141436,"imageIndex":1}]},{"id":2903519,"frames":[{"imageOffset":141436,"imageIndex":1}]},{"id":2903520,"frames":[{"imageOffset":141436,"imageIndex":1}]},{"id":2903536,"frames":[{"imageOffset":141436,"imageIndex":1}]},{"id":2903538,"name":"caulk.messenger.shared:17","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":5422,"symbol":"semaphore_wait_trap","symbolLocation":10,"imageIndex":13},{"imageOffset":8318,"symbol":"caulk::semaphore::timed_wait(double)","symbolLocation":150,"imageIndex":14},{"imageOffset":8092,"symbol":"caulk::concurrent::details::worker_thread::run()","symbolLocation":30,"imageIndex":14},{"imageOffset":7344,"symbol":"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*)","symbolLocation":41,"imageIndex":14},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]},{"id":2903578,"frames":[{"imageOffset":141436,"imageIndex":1}]},{"id":2903598,"name":"com.apple.NSEventThread","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":5554,"symbol":"mach_msg2_trap","symbolLocation":10,"imageIndex":13},{"imageOffset":63277,"symbol":"mach_msg2_internal","symbolLocation":78,"imageIndex":13},{"imageOffset":34276,"symbol":"mach_msg_overwrite","symbolLocation":692,"imageIndex":13},{"imageOffset":6298,"symbol":"mach_msg","symbolLocation":19,"imageIndex":13},{"imageOffset":510528,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":145,"imageIndex":16},{"imageOffset":505035,"symbol":"__CFRunLoopRun","symbolLocation":1365,"imageIndex":16},{"imageOffset":502044,"symbol":"CFRunLoopRunSpecific","symbolLocation":560,"imageIndex":16},{"imageOffset":1697673,"symbol":"_NSEventThread","symbolLocation":132,"imageIndex":17},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]},{"id":2903695,"name":"AudioQueue thread","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":5554,"symbol":"mach_msg2_trap","symbolLocation":10,"imageIndex":13},{"imageOffset":63277,"symbol":"mach_msg2_internal","symbolLocation":78,"imageIndex":13},{"imageOffset":34276,"symbol":"mach_msg_overwrite","symbolLocation":692,"imageIndex":13},{"imageOffset":6298,"symbol":"mach_msg","symbolLocation":19,"imageIndex":13},{"imageOffset":510528,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":145,"imageIndex":16},{"imageOffset":505035,"symbol":"__CFRunLoopRun","symbolLocation":1365,"imageIndex":16},{"imageOffset":502044,"symbol":"CFRunLoopRunSpecific","symbolLocation":560,"imageIndex":16},{"imageOffset":952299,"symbol":"audioqueue_thread","symbolLocation":1087,"imageIndex":8},{"imageOffset":417329,"symbol":"SDL_RunThread","symbolLocation":44,"imageIndex":8},{"imageOffset":874839,"symbol":"RunThread","symbolLocation":9,"imageIndex":8},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]},{"id":2903696,"name":"caulk.messenger.shared:high","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":5422,"symbol":"semaphore_wait_trap","symbolLocation":10,"imageIndex":13},{"imageOffset":8318,"symbol":"caulk::semaphore::timed_wait(double)","symbolLocation":150,"imageIndex":14},{"imageOffset":8092,"symbol":"caulk::concurrent::details::worker_thread::run()","symbolLocation":30,"imageIndex":14},{"imageOffset":7344,"symbol":"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*)","symbolLocation":41,"imageIndex":14},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]},{"id":2903697,"name":"AQConverterThread","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":16622,"symbol":"__psynch_cvwait","symbolLocation":10,"imageIndex":13},{"imageOffset":26456,"symbol":"_pthread_cond_wait","symbolLocation":1242,"imageIndex":15},{"imageOffset":178368,"symbol":"CADeprecated::CAGuard::Wait()","symbolLocation":54,"imageIndex":18},{"imageOffset":204175,"symbol":"AQConverterManager::AQConverterThread::ConverterThreadEntry(void*)","symbolLocation":729,"imageIndex":19},{"imageOffset":50091,"symbol":"CADeprecated::CAPThread::Entry(CADeprecated::CAPThread*)","symbolLocation":77,"imageIndex":18},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]},{"id":2903698,"name":"com.apple.audio.IOThread.client","frames":[{"imageOffset":140705641720232,"imageIndex":12},{"imageOffset":5554,"symbol":"mach_msg2_trap","symbolLocation":10,"imageIndex":13},{"imageOffset":63277,"symbol":"mach_msg2_internal","symbolLocation":78,"imageIndex":13},{"imageOffset":34276,"symbol":"mach_msg_overwrite","symbolLocation":692,"imageIndex":13},{"imageOffset":6298,"symbol":"mach_msg","symbolLocation":19,"imageIndex":13},{"imageOffset":3076469,"symbol":"HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int)","symbolLocation":111,"imageIndex":20},{"imageOffset":1939105,"symbol":"HALC_ProxyIOContext::IOWorkLoop()","symbolLocation":4035,"imageIndex":20},{"imageOffset":1933385,"symbol":"invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int)","symbolLocation":80,"imageIndex":20},{"imageOffset":3438918,"symbol":"HALB_IOThread::Entry(void*)","symbolLocation":72,"imageIndex":20},{"imageOffset":25043,"symbol":"_pthread_start","symbolLocation":125,"imageIndex":15},{"imageOffset":7123,"symbol":"thread_start","symbolLocation":15,"imageIndex":15}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 8673959936,
    "size" : 638976,
    "uuid" : "5db85b72-c63a-3182-91e5-5c942ec30e48",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 140703127343104,
    "size" : 196608,
    "uuid" : "c4d322c3-30c5-3c52-adb8-2fd12ec92bc0",
    "path" : "\/usr\/libexec\/rosetta\/runtime",
    "name" : "runtime"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4516573184,
    "size" : 344064,
    "uuid" : "c8f25cdc-b334-3f67-bc30-50e9852f8da2",
    "path" : "\/Library\/Apple\/*\/libRosettaRuntime",
    "name" : "libRosettaRuntime"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4371570688,
    "CFBundleShortVersionString" : "1.5.0",
    "CFBundleIdentifier" : "com.diasurgical.devilutionx",
    "size" : 3719168,
    "uuid" : "89974e25-15e4-3073-bc67-9b88e0d4ef7d",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/MacOS\/devilutionx",
    "name" : "devilutionx",
    "CFBundleVersion" : "1.5.0"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4530786304,
    "size" : 3014656,
    "uuid" : "9a52e534-b1c7-3ffc-9deb-d7d81fdddce0",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/Frameworks\/discord_game_sdk.dylib",
    "name" : "discord_game_sdk.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4522545152,
    "size" : 147456,
    "uuid" : "b574b00f-78dc-37d6-a47c-72e0e7494eaf",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/Frameworks\/libpng16.16.dylib",
    "name" : "libpng16.16.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4523372544,
    "size" : 262144,
    "uuid" : "ed7c7f70-3373-3f37-b357-10ce9700cc34",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/Frameworks\/libsodium.23.dylib",
    "name" : "libsodium.23.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4523016192,
    "size" : 81920,
    "uuid" : "26c61da9-20ee-3061-8cf0-14267cacc619",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/Frameworks\/libfmt.9.1.0.dylib",
    "name" : "libfmt.9.1.0.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4526534656,
    "size" : 1212416,
    "uuid" : "fa15f4bf-fd1e-37bc-9f2a-2c924ce26015",
    "path" : "\/Applications\/devilutionx_x86.app\/Contents\/Frameworks\/libSDL2-2.0.0.dylib",
    "name" : "libSDL2-2.0.0.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4630843392,
    "size" : 65536,
    "uuid" : "1d043270-56bc-35fb-bef3-b1ba8ecb9120",
    "path" : "\/usr\/lib\/libobjc-trampolines.dylib",
    "name" : "libobjc-trampolines.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4762808320,
    "CFBundleShortVersionString" : "1.14",
    "CFBundleIdentifier" : "com.apple.audio.units.Components",
    "size" : 1310720,
    "uuid" : "1506f5ce-501f-36b7-a132-4a058d8462dd",
    "path" : "\/System\/Library\/Components\/CoreAudio.component\/Contents\/MacOS\/CoreAudio",
    "name" : "CoreAudio",
    "CFBundleVersion" : "1.14"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4792492032,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.apple.audio.AudioDSPComponents",
    "size" : 9977856,
    "uuid" : "b2ab4808-92a3-3c11-896e-4a477cb9bc58",
    "path" : "\/System\/Library\/Components\/AudioDSP.component\/Contents\/MacOS\/AudioDSP",
    "name" : "AudioDSP",
    "CFBundleVersion" : "1"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703229767680,
    "size" : 237560,
    "uuid" : "eb4e80a0-99da-32dc-b9ad-394fbb50a0ac",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703394992128,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.apple.audio.caulk",
    "size" : 151540,
    "uuid" : "905c3d28-a423-35c6-8a02-c88ba83bc3f6",
    "path" : "\/System\/Library\/PrivateFrameworks\/caulk.framework\/Versions\/A\/caulk",
    "name" : "caulk"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703230005248,
    "size" : 49152,
    "uuid" : "8cb0b396-011f-31f2-8915-94cde1abae84",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703230418944,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 4829184,
    "uuid" : "661e8471-af64-30f9-9ce3-40bdaeeec321",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "1977"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703280947200,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.AppKit",
    "size" : 16809977,
    "uuid" : "935dfca1-61f9-377d-895a-99ef90266c86",
    "path" : "\/System\/Library\/Frameworks\/AppKit.framework\/Versions\/C\/AppKit",
    "name" : "AppKit",
    "CFBundleVersion" : "2299.60.124"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703483428864,
    "size" : 204776,
    "uuid" : "1b6c354b-02fe-36f7-84f2-edb3cf5bf565",
    "path" : "\/usr\/lib\/libAudioToolboxUtility.dylib",
    "name" : "libAudioToolboxUtility.dylib"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703501488128,
    "CFBundleShortVersionString" : "1.14",
    "CFBundleIdentifier" : "com.apple.audio.toolbox.AudioToolbox",
    "size" : 1191932,
    "uuid" : "e63118c9-2f09-38e6-89bb-5f8ebc7e3619",
    "path" : "\/System\/Library\/Frameworks\/AudioToolbox.framework\/Versions\/A\/AudioToolbox",
    "name" : "AudioToolbox",
    "CFBundleVersion" : "1.14"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703262650368,
    "CFBundleShortVersionString" : "5.0",
    "CFBundleIdentifier" : "com.apple.audio.CoreAudio",
    "size" : 7020535,
    "uuid" : "61b97c10-5b99-3184-b5b8-48f90b6eabc3",
    "path" : "\/System\/Library\/Frameworks\/CoreAudio.framework\/Versions\/A\/CoreAudio",
    "name" : "CoreAudio",
    "CFBundleVersion" : "5.0"
  }
],
  "sharedCache" : {
  "base" : 140703225872384,
  "size" : 21474836480,
  "uuid" : "e252f1ef-18e1-3e70-a017-75c8857887fa"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=646.0M resident=0K(0%) swapped_out_or_unallocated=646.0M(100%)\nWritable regions: Total=1.8G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.8G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nAccelerate framework               128K        1 \nActivity Tracing                   256K        1 \nCG backing stores                 3328K        4 \nCG image                            60K        7 \nColorSync                          236K       25 \nCoreAnimation                       76K       11 \nCoreGraphics                        12K        2 \nCoreGraphics (reserved)              8K        1         reserved VM address space (unallocated)\nCoreUI image data                 1028K        7 \nFoundation                          36K        2 \nImage IO                             4K        1 \nKernel Alloc Once                    8K        1 \nMALLOC                           298.3M       61 \nMALLOC guard page                  192K        9 \nMALLOC_MEDIUM (reserved)         952.0M        8         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nRosetta Arena                     4096K        2 \nRosetta Generic                   1128K      279 \nRosetta IndirectBranch            1024K        1 \nRosetta JIT                      128.0M        1 \nRosetta Return Stack               220K       22 \nRosetta Thread Context             220K       22 \nSTACK GUARD                         20K        5 \nStack                             13.6M       12 \nStack Guard                       56.0M        7 \nVM_ALLOCATE                       3048K       38 \nVM_ALLOCATE (reserved)              44K        4         reserved VM address space (unallocated)\n__CTF                               824        1 \n__DATA                            23.9M      505 \n__DATA_CONST                      30.2M      327 \n__DATA_DIRTY                      1392K      174 \n__FONT_DATA                        2352        1 \n__INFO_FILTER                         8        1 \n__LINKEDIT                       173.5M       16 \n__OBJC_RO                         66.3M        1 \n__OBJC_RW                         2010K        2 \n__TEXT                           472.5M      529 \ndyld private memory                260K        2 \nmapped file                        4.4G     1326 \nshared memory                     1336K       19 \nunshared pmap                     13.4M       10 \n===========                     =======  ======= \nTOTAL                              7.0G     3449 \nTOTAL, minus reserved VM space     5.7G     3449 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "a6752fdf7a5ea2fd7de1fd8b1ece2c77678bc651",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "62699e1ec1ff2978b47f6c3b",
      "factorPackIds" : {
        "SIRI_FIND_MY_CONFIGURATION_FILES" : "631f72d1de559130376df1fb"
      },
      "deploymentId" : 240000023
    },
    {
      "rolloutId" : "6391cacc75b0720ff1f8c695",
      "factorPackIds" : {
        "COREOS_ICD" : "63957f508061fa721c8edc4a"
      },
      "deploymentId" : 240000007
    }
  ],
  "experiments" : [

  ]
}
}
LupusEtFlos commented 1 year ago

and what's the crash message?

Sorry my screenshot didn't seem to attach, I'll try again after replicating the issue. Edit: screenshot attached at last. DevilutionX_20230719010708

StephenCWills commented 1 year ago

PS4 is not the only platform this occurs on: #5168

The issue is that some platforms implement what is known as a "window texture" when Upscale is turned off. SDL will create a renderer and a texture under the covers and store references to them in the window's private data. That makes these references more or less inaccessible by DevilutionX. These references can only be destroyed if the window itself is destroyed. Since, as the error message suggests, only one renderer can be associated with the window, there is no way to turn Upscale back on without causing this error.

The issue stems from the fact that SDL, as far as I know, doesn't really support this use-case. The prevailing recommendation is to use their Render API where possible, and their assumption is that applications would only use the "window surface" if they were not intending to use the Render API at all for whatever reason.

https://github.com/libsdl-org/SDL/blob/release-2.26.5/include/SDL_video.h#L1287

Below are some simple ideas I came up with for dealing with this error.


Recreate the window when Upscale is changed. We already do this in some cases on Windows systems to work around similar issues.

https://github.com/diasurgical/devilutionX/blob/1af58fa4dee4c38437550c261560f2cd77275329/Source/utils/display.cpp#L126-L146

I don't know if this would work on all platforms. Consoles in particular don't typically have an MDI in which multiple windows would really make sense so I'm not sure what would happen on PS4, for instance, if we tried to do this.


Hack in a mechanism to destroy the window texture and renderer. This is pretty straightforward and should work just fine. It's basically the same thing we do when we recreate the renderer after changing some of the other settings, except we'd have to get access to the private window data to do it.


Get rid of the Upscale option, from the Settings menu at least. If users want to switch to the window surface for whatever reason, they can modify the INI file directly. This would allow our application to work as SDL intended, only using the window surface when we don't intend to use the renderer at all.


Just ignore it. This is similar to removing the option from the menu in that users on systems that use a window texture would have to modify the INI file directly. The option would continue to work on platforms that don't use a window texture, and we'll probably continue to get crash reports from users on platforms that do. The major downside is the trap that occurs after turning Upscale off. Because the crash only occurs when turning Upscale on, you end up stuck with that setting unless you directly modify the INI.

Perhaps a hybrid solution could involve identifying the platforms that use a window texture and and only hiding the option in those cases.


Don't actually change Upscale until the user restarts the application. We can add a note to the description that specifies the setting only takes effect after closing and reopening the game.

AJenbo commented 1 year ago

Do we already destroy and recreate the window? That might solve the issue.

Alternatively I think we need a "Requires restart" flag for this sort of setting.