eventhorizon5 / skyscraper

The Skyscraper Project (Skyscrapersim) - an open source building, city, and elevator simulator
https://www.skyscrapersim.net
GNU General Public License v2.0
28 stars 7 forks source link

Closure on MacOS triggers Problem Reporter #46

Closed cat1554 closed 3 months ago

cat1554 commented 6 months ago

When closing the app on MacOS, Problem Reporter appears ("App quit unexpectedly").

Report excerpt:


Path:                  /Applications/Skyscraper.app/Contents/MacOS/Skyscraper
Identifier:            com.skyscrapersim.skyscraper
Version:               1.11.0 (1.11.0)
Build Info:            Skyscraper-Unknown~Unknown
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-02-15 09:08:10.3026 -0600
OS Version:            macOS 14.3 (23D56)
Report Version:        12
Anonymous UUID:        8ACFF6C4-2795-5F6D-4CFC-258F595260A9

[...]

Crashed Thread:        4

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000021f506e46c00
Exception Codes:       0x0000000000000001, 0x000021f506e46c00

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [89063]

VM Region Info: 0x21f506e46c00 is not in any region.  Bytes after previous region: 36855230000129  Bytes before following region: 68216849929216
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)        1000000000-7000000000   [384.0G] ---/--- SM=NUL  ...(unallocated)
--->  GAP OF 0x5f9000000000 BYTES
      MALLOC_NANO              600000000000-600020000000 [512.0M] rw-/rwx SM=PRV  

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                 0x18541362c __ulock_wait + 8
1   libsystem_pthread.dylib                0x18545449c _pthread_join + 608
2   libc++.1.dylib                         0x185387738 std::__1::thread::join() + 36
3   Ogre                                   0x1053107b4 Ogre::DefaultWorkQueue::shutdown() + 280
4   Ogre                                   0x10525f7d0 Ogre::Root::shutdown() + 76
5   Skyscraper                             0x1027ec23c Skyscraper::Skyscraper::OnExit() + 428
6   libwx_baseu-3.2.0.2.1.dylib            0x102dbc23c wxEntry(int&, wchar_t**) + 108
7   Skyscraper                             0x1027e6300 main + 24
8   dyld                                   0x1850d10e0 start + 2360

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

Thread 2:: com.apple.NSEventThread
0   libsystem_kernel.dylib                 0x185411874 mach_msg2_trap + 8
1   libsystem_kernel.dylib                 0x185423cf0 mach_msg2_internal + 80
2   libsystem_kernel.dylib                 0x18541a4b0 mach_msg_overwrite + 476
3   libsystem_kernel.dylib                 0x185411bf8 mach_msg + 24
4   CoreFoundation                         0x18552fb84 __CFRunLoopServiceMachPort + 160
5   CoreFoundation                         0x18552e44c __CFRunLoopRun + 1208
6   CoreFoundation                         0x18552d93c CFRunLoopRunSpecific + 608
7   AppKit                                 0x188e36160 _NSEventThread + 144
8   libsystem_pthread.dylib                0x185452034 _pthread_start + 136
9   libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 3:
0   QuartzCore                             0x18d6213d4 CA::Render::Message::send_message() + 0
1   QuartzCore                             0x18d882700 CA::Render::Encoder::send_message(unsigned int, unsigned int, unsigned int*, unsigned long) + 868
2   QuartzCore                             0x18d7abfd8 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 13364
3   QuartzCore                             0x18d6068f0 CA::Transaction::commit() + 648
4   QuartzCore                             0x18d621834 CA::Transaction::release_thread(void*) + 228
5   libsystem_pthread.dylib                0x18544f9fc _pthread_tsd_cleanup + 620
6   libsystem_pthread.dylib                0x185452724 _pthread_exit + 84
7   libsystem_pthread.dylib                0x185452040 _pthread_start + 148
8   libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 4 Crashed:
0   libobjc.A.dylib                        0x185083ff0 objc_release + 16
1   AppKit                                 0x1890da6a8 0x188cd3000 + 4224680
2   AppKit                                 0x1890baea4 0x188cd3000 + 4095652
3   AppKit                                 0x1890bb22c 0x188cd3000 + 4096556
4   AppKit                                 0x189350d48 -[NSViewBackingLayer display] + 1272
5   QuartzCore                             0x18d623b3c CA::Layer::display_if_needed(CA::Transaction*) + 736
6   QuartzCore                             0x18d7a8da4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 512
7   QuartzCore                             0x18d6068f0 CA::Transaction::commit() + 648
8   QuartzCore                             0x18d621834 CA::Transaction::release_thread(void*) + 228
9   libsystem_pthread.dylib                0x18544f9fc _pthread_tsd_cleanup + 620
10  libsystem_pthread.dylib                0x185452724 _pthread_exit + 84
11  libsystem_pthread.dylib                0x185452040 _pthread_start + 148
12  libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 5:: caulk.messenger.shared:17
0   libsystem_kernel.dylib                 0x1854117f0 semaphore_wait_trap + 8
1   caulk                                  0x18f7f2690 caulk::semaphore::timed_wait(double) + 212
2   caulk                                  0x18f7f2544 caulk::concurrent::details::worker_thread::run() + 36
3   caulk                                  0x18f7f2244 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*) + 96
4   libsystem_pthread.dylib                0x185452034 _pthread_start + 136
5   libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 6:: caulk.messenger.shared:high
0   libsystem_kernel.dylib                 0x1854117f0 semaphore_wait_trap + 8
1   caulk                                  0x18f7f2690 caulk::semaphore::timed_wait(double) + 212
2   caulk                                  0x18f7f2544 caulk::concurrent::details::worker_thread::run() + 36
3   caulk                                  0x18f7f2244 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*) + 96
4   libsystem_pthread.dylib                0x185452034 _pthread_start + 136
5   libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 7:: caulk::deferred_logger
0   libsystem_kernel.dylib                 0x1854117f0 semaphore_wait_trap + 8
1   caulk                                  0x18f7f2690 caulk::semaphore::timed_wait(double) + 212
2   caulk                                  0x18f7f2544 caulk::concurrent::details::worker_thread::run() + 36
3   caulk                                  0x18f7f2244 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*) + 96
4   libsystem_pthread.dylib                0x185452034 _pthread_start + 136
5   libsystem_pthread.dylib                0x18544ce3c thread_start + 8

Thread 8:
0   libsystem_pthread.dylib                0x18544ce28 start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib                0x18544ce28 start_wqthread + 0

Thread 10:
0   libsystem_pthread.dylib                0x18544ce28 start_wqthread + 0

Thread 11:
0   libsystem_pthread.dylib                0x18544ce28 start_wqthread + 0

Thread 4 crashed with ARM Thread State (64-bit):
    x0: 0x0000600001056be0   x1: 0x0000000000000000   x2: 0x000021f506e46be0   x3: 0x000000000000000a
    x4: 0x0000000045ed8000   x5: 0x0000000000002260   x6: 0x0000000000000800   x7: 0x0000000000000000
    x8: 0x000000000000ffff   x9: 0x0001000000000000  x10: 0x0000492484004c80  x11: 0x0000000000000000
   x12: 0x0000000000000002  x13: 0x0000000143028730  x14: 0x01000001dbd38da9  x15: 0x00000001dbd38da8
   x16: 0x000021f506e46be0  x17: 0x00000001dd5ea698  x18: 0x0000000000000000  x19: 0x0000600001056be0
   x20: 0x0000600003097288  x21: 0x00000001dbd819f8  x22: 0x000000016dad9238  x23: 0x00000001dc35d578
   x24: 0x00000001dbdcacf8  x25: 0x000000016dad9130  x26: 0x00000001dbdcad98  x27: 0x00000001890b8274
   x28: 0x000000016dad9268   fp: 0x000000016dad9120   lr: 0x00000001890da6a8
    sp: 0x000000016dad90d0   pc: 0x0000000185083ff0 cpsr: 0x00001000
   far: 0x000021f506e46c00  esr: 0x92000005 (Data Abort) byte read Translation fault
eventhorizon5 commented 6 months ago

I was recently experiencing this bug, but wasn't sure what was causing it. I'll look into it.

eventhorizon5 commented 6 months ago

I'm having the code skip the main Ogre shutdown command on Mac systems, which appears to fix the problem, and the change is in Git now.