#13973 closed defect (fixed)

THE DIG: Crash - Error: convertMessageToString: buffer overflow!

Reported by: Bautler Owned by: AndywinXp
Priority: normal Component: Engine: SCUMM
Version: Keywords: The Dig, buffer overflow, error
Cc: Game: The Dig



I'm not very good at English, sorry.

The problem:
In the middle of the conversation with the monster from the crystal pyramid, the console opens and gives the following error:

Error: convertMessageToString: buffer overflow!

I didn't find anything via the search engine.

Attachments (2)

dig-de.s00 (48.1 KB ) - added by Bautler 14 months ago.
dig-steam-win-de.s02 (52.1 KB ) - added by dwatteau 14 months ago.
Load this savegame from German Steam release. Click on "seltsames Gerät" (the bridge) icon twice

Download all attachments as: .zip

Change History (11)

by Bautler, 14 months ago

Attachment: dig-de.s00 added

comment:1 by AndywinXp, 14 months ago

Hi! Thanks for the report; have you tried the latest development build? https://www.scummvm.org/downloads/#daily

Let us know!

comment:2 by Bautler, 14 months ago


Yes, i have the newest version. The Error will appear when Maggie says:
„When you say, "The eye will see," you aren´t talking about our eyes, are you?“

Last message in console is:
Read 3 history entries


[2022-12-23 00:11:29] ScummVM 2.6.1 (Oct 17 2022 10:09:38)
[2022-12-23 00:11:29] Vorbis FLAC MP3 RGB zLib MPEG2 FluidSynth Theora AAC A/52 FreeType2 FriBiDi JPEG PNG GIF taskbar TTS cloud (servers, local) TinyGL OpenGL (with shaders) 
[2022-12-23 00:11:29] --- Log opened.
[2022-12-23 00:13:49] convertMessageToString: buffer overflow!
[2022-12-23 00:13:49] Debugger started, type 'exit' to return to the game.
[2022-12-23 00:13:49] Type 'help' to see a little list of commands and variables.
[2022-12-23 00:13:49] ERROR: convertMessageToString: buffer overflow!
[2022-12-23 00:13:49] Read 3 history entries
[2022-12-23 00:13:53] --- Log closed successfully.

Maybe some information help:
OS: Win7x64
Im playing this game in German.

comment:3 by dwatteau, 14 months ago


Thank you for reporting this. Although your log file above says "ScummVM 2.6.1" (which is not a development build but a release build), I can still reproduce this with the current development version (even with the recent bugfix for the Japanese release of The Dig).

Here's a savegame where I can trigger this issue with the German release from Steam. (warning: the savegame comes from an old save of mine from the French release, but it appears to work...).

by dwatteau, 14 months ago

Attachment: dig-steam-win-de.s02 added

Load this savegame from German Steam release. Click on "seltsames Gerät" (the bridge) icon twice

comment:4 by dwatteau, 14 months ago

Ah, didn't see that you provided your own save too, sorry.

Here's what UBsan says when this happens:

engines/scumm/string_v7.cpp:597:4: runtime error: index 256 out of bounds for type 'byte[256]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior engines/scumm/string_v7.cpp:597:4 in 
convertMessageToString: buffer overflow!

in reply to:  4 comment:5 by Bautler, 14 months ago


Thanks for the answers! Sorry, i have this read fast..
Youre savegame works fine. Hmm.. out of Bounds. Maybe the text from Maggie?

"Das Auge..." is out of Bounds.https://i.imgur.com/nB3uR8p.png

comment:6 by dwatteau, 14 months ago

I think it's more related to the reply from the creature; its text has around 225 characters in English. It looks like we have a limit to 256 characters, but German being quite a verbose language in comparison, I think the German translation might just overflow it (I can't get the same scene to crash in the French release). (And The Dig uses a translation table, while earlier games would just hardcode the translated strings into the original scripts.)

I don't know how the original German interpreter behaved in that case. Maybe it has a higher limit, or maybe the buffer overflow wasn't triggered, just by luck. Or maybe the problem is unrelated to the length of that string, but that seems unlikely to me.

I think someone from our SCUMM team is going to figure this out soon, don't worry :) Thanks for reporting this and testing every dialogue option in The Dig, because this may be a very old bug!

comment:7 by Bautler, 14 months ago

Yea, sounds plausible. I have found the Text in a YouTube video. I guess i was unlucky with this error... :D (Video is from 12.04.2020)


and no Problem, i like to help. And thanks for the Save-File. So i can play this Game to finish.
Hmm... yesterday the save file was still working. I copied the save file again and it crashed again. Good that after this conversation was an autosave...

comment:8 by AndywinXp, 14 months ago

Thanks for the report! This has been fixed in master :-) Merry Xmas!

comment:9 by AndywinXp, 14 months ago

Owner: set to AndywinXp
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.