Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#6796 closed defect (fixed)

The Dig crashes ScummVM in the middle of the opening movie.

Reported by: SF/mcnugget Owned by: criezy
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: The Dig

Description

Hi.

ScummVM 1.7.0, Mac OS X Yosemite 10.10.2. The Dig, Steam/Mac, English, directly imported from Steam's game directory.

Crashes 3 minutes and 45 seconds into the opening movie.

Ticket imported from: bugs/6796.

Attachments (1)

Crash.txt (43.9 KB ) - added by SF/mcnugget 10 years ago.

Download all attachments as: .zip

Change History (7)

by SF/mcnugget, 10 years ago

Attachment: Crash.txt added

comment:1 by criezy, 10 years ago

I confirm it crashes for me as well. Here is the callstack I get for the crash on Linux: 0 __memcpy_ssse3_rep () at ../sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S:1311 1 0x080c6de2 in Scumm::SmushFont::drawString (this=0xb1ab3f8, str=0xb440224 "\n#define a 1\nOf course I miss you, darlin'.\n\n#define a 2\nThis is the loneliest place on earth.\n\n#define a 3\nMost exciting thing ever happens here is a day when it don't rain.\n\n#define a 4\nWhat the hec"..., buffer=0xafc4388 "//\225ޣggg\243og!g!\243o\243og!!!!!!!!!;bGo!!!!!!!!;;!;!!!\027;G(Q?(T\265(\177\177QQ?Q\205M\246M\246\034\214\033\033\214\033\033\033\033\033\033\034lQǾZT\034\033\214\034\214M\177?\307Z\276\257Z\203\334t\212\233\316x\316\307\307\300\272ƙ\023\023\272\267\306Nj\360\253\264\242\314̸\270\267l\353\260EE%%%$$$0\266\206]]UuuBOOJJAA\305i}}F==CC77@@@855566**44)))''''dd", '\030'

comment:2 by criezy, 10 years ago

And here is the valgrind report: ==20714== Invalid read of size 4 ==20714== at 0x402DB26: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==20714== by 0x696C7260: ??? ==20714== Address 0x75d2c64 is 4 bytes before a block of size 10,273 alloc'd ==20714== at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==20714== by 0x80C244F: Scumm::SmushPlayer::handleTextResource(unsigned int, int, Common::SeekableReadStream&) (smush_player.cpp:587) ==20714== by 0x80C34FB: Scumm::SmushPlayer::handleFrame(int, Common::SeekableReadStream&) (smush_player.cpp:862) ==20714== by 0x80C407D: Scumm::SmushPlayer::parseNextFrame() (smush_player.cpp:1034) ==20714== by 0x80C0FB2: Scumm::SmushPlayer::timerCallback() (smush_player.cpp:207) ==20714== by 0x80C4BC8: Scumm::SmushPlayer::play(char const, int, int, int) (smush_player.cpp:1206) ==20714== by 0x81CBE93: Scumm::ScummEngine_v7::o6_kernelSetFunctions() (script_v6.cpp:2507) ==20714== by 0x81CE180: Common::Functor0Mem

comment:3 by criezy, 10 years ago

In addition to the crash, there are two issues that occur with the Steam mac version: I get hundreds of warnings of the form WARNING: invalid string id : 63! Also I get "undefined string" displayed on screen when it should display the credits or subtitles.

I had a quick look at the code and it appears line ending is not correctly handled for the Steam mac version. All issues (the two above and the crash) are fixed if I add the following to engine/scumm/smush/smush_player.cpp at line 118: // In Steam mac version LF is used instead of CR-LF if (data_end[-2] == '\n' && data_end[-1] == '\n') { break; }

I can commit that change if that looks fine to devs who are more familiar than I am with the SCUMM engine.

comment:4 by bluegr, 10 years ago

I've just tested this, and you're right: the Mac Steam version does use LF, instead of CR+LF

Here's an excerpt: "#define a 1\n^f00Of course I miss you, darlin'.\n\n#define a 2\n^f00This is the loneliest place on earth.\n\n#define a 3\n^f00Most exciting thing ever happens here is a day when it don't rain.\n\n#define a 4\n^..."

I've playtested your patch, and it works as expected, plus it's quite self-contained and to the point. Feel free to commit it and close this bug.

comment:5 by criezy, 10 years ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

comment:6 by criezy, 10 years ago

Fixed in commit f1c64c2afe.

Note: See TracTickets for help on using tickets.