Opened 3 months ago

Closed 3 months ago

#14892 closed defect (fixed)

DOTT: Crash when trying to play MM on Ed's computer

Reported by: alexbevi Owned by: lephilousophe
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Day of the Tentacle

Description (last modified by alexbevi)

ScummVM 2.9.0git1616-g563456df1eb (Jan 19 2024 05:37:02)
Using SDL backend with SDL 2.28.5
Features compiled in: TAINTED Vorbis FLAC MP3 TiMidity RGB zLib MPEG2 FluidSynth Theora VPX AAC A/52 FreeType2 FriBiDi JPEG PNG GIF taskbar TTS cloud (servers, local) ENet SDL2 TinyGL OpenGL (with shaders) OpenGL desktop only
  • Go to Ed's room
  • Look at the computer
User picked target 'tentacle' (engine ID 'scumm', game ID 'tentacle')...
   Looking for a plugin supporting this target... SCUMM [all games]
Assertion failed: (endP >= beginP), function BaseString, file str-base.cpp, line 118.
[1]    25247 abort      scummvm

Attachments (1)

tentacle.s01 (28.3 KB ) - added by alexbevi 3 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 by alexbevi, 3 months ago

Description: modified (diff)

comment:2 by alexbevi, 3 months ago

Game: Day of the Tentacle

comment:3 by eriktorbjorn, 3 months ago

Edit: Oops, that comment was meant for another bug report.

Last edited 3 months ago by eriktorbjorn (previous) (diff)

comment:4 by eriktorbjorn, 3 months ago

I wasn't able to reproduce it, but I assume it happens somewhere in ScummEngine::startManiac(). It does some string manipulation to try and figure out which game to start.

comment:5 by AndywinXp, 3 months ago

It seems that there's some issue in how ScummVM code reacts to at least one of your folder paths. Can you try moving the whole game, including its internal MANIAC folder on a simpler and shorter path, maybe without special characters (like accented letters)?

by alexbevi, 3 months ago

Attachment: tentacle.s01 added

comment:6 by alexbevi, 3 months ago

I removed the game from scummvm, updated the path to /Users/alex/Downloads/dott and readded it. Loaded a save state and tried again and it still crashes.

Attached savefile in case it helps.

comment:7 by alexbevi, 3 months ago

Actually, I think the issue is I'm missing the MANIAC folder - which would explain why this doesn't work.

Might make sense for startManiac() to validate the presence of the folder and just throw a warning instead of crashing scummvm.

comment:8 by alexbevi, 3 months ago

If it helps any this is the stack trace

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff81528b1e2 __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff8152c2ee6 pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff8151e9b45 abort + 123
3   libsystem_c.dylib             	    0x7ff8151e8e5e __assert_rtn + 314
4   scummvm                       	       0x10aef4136 Common::BaseString<char>::BaseString(char const*, char const*) + 102 (str-base.cpp:118)
5   scummvm                       	       0x1064e5bc5 Common::String::String(char const*, char const*) + 37 (str.h:78)
6   scummvm                       	       0x1064e5985 Common::String::String(char const*, char const*) + 37 (str.h:78)
7   scummvm                       	       0x10aee7551 Common::Path::extract(char const*, char const*) const + 289 (path.cpp:261)
8   scummvm                       	       0x10aee8c9c Common::Path::relativeTo(Common::Path const&) const + 140 (path.cpp:680)
9   scummvm                       	       0x10642cacc Scumm::ScummEngine::startManiac() + 460 (scumm.cpp:3770)
10  scummvm                       	       0x106411791 Scumm::ScummEngine_v6::o6_kernelSetFunctions() + 273 (script_v6.cpp:3000)
11  scummvm                       	       0x106412503 Common::Functor0Mem<void, Scumm::ScummEngine_v6>::operator()() const + 99 (func.h:397)
12  scummvm                       	       0x106413eee Scumm::ScummEngine::executeOpcode(unsigned char) + 126 (script.cpp:492)
13  scummvm                       	       0x106413d78 Scumm::ScummEngine::executeScript() + 472 (script.cpp:485)
14  scummvm                       	       0x106412bfd Scumm::ScummEngine::runScriptNested(int) + 269 (script.cpp:337)
15  scummvm                       	       0x106412ecc Scumm::ScummEngine::runObjectScript(int, int, bool, bool, int*, int, int) + 492 (script.cpp:136)
16  scummvm                       	       0x10640860a Scumm::ScummEngine_v6::o6_startObject() + 186 (script_v6.cpp:1020)
17  scummvm                       	       0x106412503 Common::Functor0Mem<void, Scumm::ScummEngine_v6>::operator()() const + 99 (func.h:397)
18  scummvm                       	       0x106413eee Scumm::ScummEngine::executeOpcode(unsigned char) + 126 (script.cpp:492)
19  scummvm                       	       0x106413d78 Scumm::ScummEngine::executeScript() + 472 (script.cpp:485)
20  scummvm                       	       0x106412bfd Scumm::ScummEngine::runScriptNested(int) + 269 (script.cpp:337)
21  scummvm                       	       0x1064127a2 Scumm::ScummEngine::runScript(int, bool, bool, int*, int) + 626 (script.cpp:89)
22  scummvm                       	       0x1064170b9 Scumm::ScummEngine::checkAndRunSentenceScript() + 1113 (script.cpp:1175)
23  scummvm                       	       0x106428ef8 Scumm::ScummEngine::scummLoop(int) + 1496 (scumm.cpp:2738)
24  scummvm                       	       0x106428493 Scumm::ScummEngine::go() + 819 (scumm.cpp:2469)
25  scummvm                       	       0x1062de0c2 Scumm::ScummEngine::run() + 178 (scumm.h:583)
26  scummvm                       	       0x10628c791 runGame(Plugin const*, Plugin const*, OSystem&, Common::String const&) + 3793 (main.cpp:326)
27  scummvm                       	       0x10628a259 scummvm_main + 6233 (main.cpp:806)
28  scummvm                       	       0x106283a9a main + 202 (macosx-main.cpp:44)
29  dyld                          	    0x7ff814f6941f start + 1903

comment:9 by eriktorbjorn, 3 months ago

I was able to reproduce it with a scummvm.ini where Day of the Tentacle was the only game I had added.

At this point, it's looping through all installed games trying to find one that's installed in a "maniac" sub-folder to the current one. One of the games it checks is Day of the Tentacle itself, i.e. it will check if a path is relative to itself.

This leads to Path::extract("", nullptr) being called, where "" is one byte after what it calculates as the string's end point. Then it tries to create a new string from that begin/end, and that's where it crashes. I think.

We could easily check that path != currentPath in the startManiac() loop, but it seems to me that path.relativeTo(currentPath) shouldn't be allowed to crash when path.isRelativeTo(currentPath) is true. Which leads to the question, should a path be considered relative to itself or not? Seems like a question for Le Philousophe.

By the way, we could probably replace the path.toString('/').matchString("*maniac*", ...) check with something simpler now, after the recent "Migrate engine to Path" changes? Perhaps check (case insensitive) what path.getLastComponent() points to? It looks like that would strip away any trailing path separators, which was the point of using matchString() to begin with.

comment:10 by lephilousophe, 3 months ago

Hello,

Thanks for the report.
I fixed the crash in Path class in aceaf9981617120ea9e6ba138bc521b6a2f56742.

comment:11 by eriktorbjorn, 3 months ago

Owner: set to lephilousophe
Resolution: fixed
Status: newclosed

So I guess it's fixed then. But if not, feel free to reopen.

Note: See TracTickets for help on using tickets.