[Scummvm-tracker] [ScummVM :: Bugs] #13242: SKY: Beneath a Steel Sky crashing on MacOS M1

ScummVM :: Bugs trac at scummvm.org
Wed Oct 12 22:33:44 UTC 2022


#13242: SKY: Beneath a Steel Sky crashing on MacOS M1
------------------------+----------------------------------
Reporter:  DanielNovak  |       Owner:  (none)
    Type:  defect       |      Status:  new
Priority:  normal       |   Component:  Engine: Sky
 Version:               |  Resolution:
Keywords:  macos m1     |        Game:  Beneath a Steel Sky
------------------------+----------------------------------
Comment (by criezy):

 I can reproduce this issue but only with the native M1 version compiled
 with optimisation. Running a debug version, or a x86 version under Rosetta
 works properly.

 This at least provides a workaround for the users as they can force
 running the ScummVM release versions under Rosetta:
 - Select the ScummVM.app, and then press Command-I (or right-click / use
 the File menu and select Get Info). This will open an Info window with
 details about the app.
 - In the Info window, look for a checkbox labeled, “Open using Rosetta”.
 Check the box.
 - Start ScummVM and enjoy playing.

 Details tests on a M1 mac:
 - ScummVM 2.2.0 (Rosetta) does not crash
 - ScummVM 2.5.1 (Native)  crashes
 - ScummVM 2.5.1 (Rosetta) does not crashes
 - ScummVM 2.6.0 (Native)  crashes
 - ScummVM 2.6.0 (Rosetta) does not crashes
 - master `--enable-asan` (Native): does not crash (no error reported by
 ASAN)
 - master `--enable-asan --enable-optimizations` (Native): crashes (see
 report below)


 ASAN report:
 {{{
 =================================================================
 ==77011==ERROR: AddressSanitizer: heap-buffer-overflow on address
 0x00012d8a0503 at pc 0x000100d93434 bp 0x00016f1b37d0 sp 0x00016f1b37c8
 READ of size 1 at 0x00012d8a0503 thread T0
     #0 0x100d93430 in Sky::RncDecoder::unpackM1(void const*, void*,
 unsigned short) rnc_deco.cpp:249
     #1 0x100d6d364 in Sky::Disk::loadFile(unsigned short) disk.cpp:146
     #2 0x100d6ddb0 in Sky::Disk::refreshFilesList(unsigned int*)
 disk.cpp:287
     #3 0x100d673e4 in Sky::Control::parseSaveData(unsigned char*)
 control.cpp:1450
     #4 0x100d5f1cc in Sky::Control::restartGame() control.cpp:1549
     #5 0x100d9dddc in Sky::SkyEngine::go() sky.cpp:219
     #6 0x100da1134 in Sky::SkyEngine::run() sky.h:122
     #7 0x100d044d0 in scummvm_main main.cpp:619
     #8 0x100cf802c in main macosx-main.cpp:44
     #9 0x1894e542c in start+0x0 (libdyld.dylib:arm64e+0x1842c)

 0x00012d8a0503 is located 765 bytes to the left of 70678-byte region
 [0x00012d8a0800,0x00012d8b1c16)
 allocated by thread T0 here:
     #0 0x103dc0f54 in wrap_malloc+0x94
 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3cf54)
     #1 0x100d6d334 in Sky::Disk::loadFile(unsigned short) disk.cpp:127
     #2 0x100d6ddb0 in Sky::Disk::refreshFilesList(unsigned int*)
 disk.cpp:287
     #3 0x100d673e4 in Sky::Control::parseSaveData(unsigned char*)
 control.cpp:1450
     #4 0x100d5f1cc in Sky::Control::restartGame() control.cpp:1549
     #5 0x100d9dddc in Sky::SkyEngine::go() sky.cpp:219
     #6 0x100da1134 in Sky::SkyEngine::run() sky.h:122
     #7 0x100d044d0 in scummvm_main main.cpp:619
     #8 0x100cf802c in main macosx-main.cpp:44
     #9 0x1894e542c in start+0x0 (libdyld.dylib:arm64e+0x1842c)
 }}}

 I am worried this could be a compiler bug, in which case that could be
 complicated to fix.
-- 
Ticket URL: <https://bugs.scummvm.org/ticket/13242#comment:3>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM


More information about the Scummvm-tracker mailing list