Opened 2 days ago

Last modified 18 hours ago

#15241 new defect

AGI: Mixed-Up Mother Goose (DOS) - Segmentation fault on item return (ScummVM 2.8.1+)

Reported by: hugoarpin Owned by:
Priority: normal Component: Engine: AGI
Version: Keywords:
Cc: hugoarpin Game: Mixed-Up Mother Goose

Description

Game: Mixed-Up Mother Goose (DOS)
Md5sum: e524655abf9b96a3b179ffcd1d0f79af LOGDIR
Version: Scummvm v2.8.1 (Arch Linux) & commit 3853dd99b5c

Almost every time an item is returned (see attached screenshot), after the song and text, when a cursor key is pressed to move and dismiss the text box, I get a segmentation fault.

I recall testing (and completing) the game in the past (probably v2.8.0 or maybe earlier) and the bug was not present. I have not tested on other OS (ex: Windows), so I don't know if it is Linux specific.

Here is the gdb output of the error (commit 3853dd99b5c):
Thread 1 "scummvm" received signal SIGSEGV, Segmentation fault.
Agi::GfxMgr::render_BlockEGA (this=0x55555d3248c0, x=3, y=-5, width=146, height=42) at engines/agi/graphics.cpp:599
599 curColor = _activeScreen[offsetVisual++];

PS: Sorry if the error is due to a bad configuration on my part, but at this point I can't see it.

Attachments (1)

Bug trigger.png (65.8 KB ) - added by hugoarpin 2 days ago.

Download all attachments as: .zip

Change History (5)

by hugoarpin, 2 days ago

Attachment: Bug trigger.png added

comment:1 by sluicebox, 38 hours ago

Hello! Thank you for reporting this. Also, excellent taste in games!

I can reproduce this crash with Windows release 2.8.1, but so far I am unable to reproduce it with anything else. I touched code that affected some of the the rhymes in 2.8.1, so it seems like it's probably going to be that. I can't explain why it's not happening elsewhere.

If you're able to build from source, that might avoid the problem for now. And once it's really fixed, you'd need to do that anyway.

I can see from the details you provided that things are going awry in a way that's related to my fix for #13820 , so I know where to look.

Last edited 37 hours ago by sluicebox (previous) (diff)

comment:2 by hugoarpin, 28 hours ago

Hi sluicebox,

Thanks for the help! I have learnt of you through the impressive OneShortEye videos. I did not know you also worked on the AGI engine (on top of SCI), amazing!

I have built the recent commits 3853dd99b5c yesterday and 0856bf2003e this morning, both of them segfault on my Arch Linux system.

But interestingly, Jack Horner didn't crash (pie to boy in house at lower right), but Banbury Cross did (horse to town centre).

So as you said, it seems to only affect certain rhymes. I will try to give you an exhaustive list of the crashes tonight (hoping that I will have enough free time).

I have also built commit bc8550ce02a, which is the one you linked to inside the ticket #13820 and it also crashed at the line mentioned in my previous message (engines/agi/graphics.cpp:599 curColor = _activeScreen[offsetVisual++]).

However, when I built the commit just before (8f2127e4184), the text box was a bit messed up because the refactor was not yet complete, but it did not segfault, so it seems that bc8550ce02a could be the cause.

I hope the seemingly somewhat platform-specific nature of the bug will not be too difficult to hunt/fix! Linux can be such a pain sometimes...

PS: I tried this game(s) because it showcased so many engine evolutions (AGI / SCI dithered EGA / SCI VGA talkie / SCI deluxe 640x480). But I must say that I found it quite charming and that it is still a beautiful game for young boys & girls nowadays IMO!

comment:3 by sluicebox, 24 hours ago

Thank you for reminding me that I said I'd pick him up from an airport!

I thought it would be fun to learn AGI this year, and it was, but I also broke this so maybe not *that* amazing =)

The rhymes that crash are the ones from #13820:

  • Hickory Dickory Dock
  • Crooked Man
  • Jack Sprat
  • Old Woman Who Lived In A Shoe
  • Banbury Cross

Their rhyme text boxes are so big that Sierra placed them over the menu bar up top. That's so unusual that, according to a scan I did, it doesn't happen in other AGI games. The authors of our AGI code understandably didn't expect that, so those message boxes didn't work. I changed the graphics code so that it would draw, but now I see that the code that clears the message box also needs adjustments.

Thanks for bisecting this. This was the first real computer game I ever played. Now I "just" need to sit down with a lot of scratch paper, draw some diagrams, and do some children's arithmetic. (we're doomed!)

comment:4 by hugoarpin, 18 hours ago

Hahaha, don't forget Shorty or he'll make a video to slander you! :p

I can see that you are already way ahead of me for testing the issue. Thank you for explaining simply to me the technical details about the text boxes and menu bar!

I've just built the older v2.8.0 and compared with DOSBox, your work is a clear improvement, as the text box for these rhymes was obviously messed up in ScummVM before!

Still puzzling as to why it occurs (mostly) on Linux, as it seems the issue is deep inside the AGI engine and not so much because of some system interaction, weird!? Oh Linux...

Anyway, I hope this will not take too much of your time and sorry I can't help more, as it would probably take me days (or weeks) to get familiar enough with the AGI engine to be useful!

But if you ever want/need me to test anything on my (wonderful?) Arch Linux system before committing to the ScummVM repo, please send me the patch!

Note: See TracTickets for help on using tickets.