Opened 12 years ago

Closed 10 years ago

#3155 closed defect

GOB2: Seg fault when trying to switch screen in music land

Reported by: spookypeanut Owned by: DrMcCoy
Priority: low Component: Engine: Gob
Keywords: Cc:
Game: Gobliins 2

Description

In gob2, in the music world place (from Vivalzart the bird's treehouse), if the "MOVEMENT" icon (from the drop-down toolbar) is selected, ScummVM segfaults. No other errors / warnings, even with debug level 7.

I'm guessing it's because there's nowhere else to go... I don't know what the behaviour should be. Gonna check in dosbox, but need to figure out all the cdrdao / head / tail gubbins to get it working first :-)

I've attached a savegame from music world.

Ticket imported from: #1705338. Ticket imported from: bugs/3155.

Attachments (3)

gob2cd.s04 (2.7 KB) - added by spookypeanut 12 years ago.
savegame in music world
gob2cd.s14 (2.8 KB) - added by spookypeanut 12 years ago.
savegame from just before music land
gob2cd.s02 (2.8 KB) - added by spookypeanut 10 years ago.
savegame from tree screen, having completed music land

Download all attachments as: .zip

Change History (31)

Changed 12 years ago by spookypeanut

Attachment: gob2cd.s04 added

savegame in music world

comment:1 Changed 12 years ago by DrMcCoy

Owner: set to DrMcCoy

comment:2 Changed 12 years ago by spookypeanut

Got it working in dosbox, and hen you click on the "MOVEMENT" icon in music world, nothing happens at all (nothing pops up)

comment:3 Changed 12 years ago by spookypeanut

I suspect this is related, so I'll put it here as well. Let me know if you'd like a separate report. Told you I'd find more bugs ;-)

Having finished music land (at last!), when clicking the MOVEMENT icon, nothing happens. In the original interpreter, this shows the one other place that it's possible to go (the trench). The same thing happens at the trench (but the other way round).

comment:4 Changed 12 years ago by DrMcCoy

Could you try and look whether my attempted fix for #1706988 chances anything for this bug(s) as well? You'd have to start with a save from before musicland, though.

comment:5 Changed 12 years ago by spookypeanut

No, fraid not. Still the same problem with revision 26727.

comment:6 Changed 12 years ago by sev-

(gdb) thread 4
[Switching to thread 4 (Thread 0x8187000 (runnable))]#0 0x28c6f6e6 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0', j=9 '\t',
params=@0xbfbfd66c) at engines/gob/inter_v2.cpp:680
680 return (this->*op) (params);
(gdb) bt
#0 0x28c6f6e6 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=9 '\t', params=@0xbfbfd66c) at engines/gob/inter_v2.cpp:680
#1 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=1)
at engines/gob/inter.cpp:242
#2 0x28c67034 in Gob::Inter_v1::o1_repeatUntil (this=0x82fbc00,
params=@0xbfbfd70c) at engines/gob/inter_v1.cpp:1230
#3 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=6 '\006', params=@0xbfbfd70c) at engines/gob/inter_v2.cpp:680
#4 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:242
#5 0x28c64665 in Gob::Inter::callSub (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:270
#6 0x28c66c1c in Gob::Inter_v1::o1_callSub (this=0x82fbc00,
params=@0xbfbfd7cc) at engines/gob/inter_v1.cpp:1154
#7 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=0 '\0', params=@0xbfbfd7cc) at engines/gob/inter_v2.cpp:680
#8 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=0)
at engines/gob/inter.cpp:242
#9 0x28c672f0 in Gob::Inter_v1::o1_if (this=0x82fbc00, params=@0xbfbfd86c)
at engines/gob/inter_v1.cpp:1294
#10 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=8 '\b', params=@0xbfbfd86c) at engines/gob/inter_v2.cpp:680
#11 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:242
#12 0x28c64665 in Gob::Inter::callSub (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:270
#13 0x28c476d5 in Gob::Game_v2::playTot (this=0x8291000, skipPlay=4)
at engines/gob/game_v2.cpp:282
#14 0x28c3fb8e in Gob::Game::switchTotSub (this=0x8291000, index=0, skipPlay=4)
at engines/gob/game.cpp:580
#15 0x28c7179c in Gob::Inter_v2::o2_switchTotSub (this=0x82fbc00)
at engines/gob/inter_v2.cpp:1146
#16 0x28c6f5b2 in Gob::Inter_v2::executeDrawOpcode (this=0x82fbc00, i=65 'A')
at engines/gob/inter_v2.cpp:663
#17 0x28c68f09 in Gob::Inter_v1::o1_drawOperations (this=0x82fbc00,
params=@0xbfbfda8c) at engines/gob/inter_v1.cpp:1719
#18 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00,
i=1 '\001', j=14 '\016', params=@0xbfbfda8c)
at engines/gob/inter_v2.cpp:680
#19 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=0)
at engines/gob/inter.cpp:242
#20 0x28c672f0 in Gob::Inter_v1::o1_if (this=0x82fbc00, params=@0xbfbfdb2c)
at engines/gob/inter_v1.cpp:1294
#21 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=8 '\b', params=@0xbfbfdb2c) at engines/gob/inter_v2.cpp:680
#22 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=0)
at engines/gob/inter.cpp:242
#23 0x28c403c2 in Gob::Game::collSub (this=0x8291000, offset=12419)
---Type <return> to continue, or q <return> to quit---
at engines/gob/game.cpp:726
#24 0x28c40554 in Gob::Game::collAreaSub (this=0x8291000, index=2,
enter=1 '\001') at engines/gob/game.cpp:750
#25 0x28c484a3 in Gob::Game_v2::checkCollisions (this=0x8291000,
handleMouse=1 '\001', deltaTime=-2, pResId=0x829170e, pResIndex=0x8291710)
at engines/gob/game_v2.cpp:529
#26 0x28c4a123 in Gob::Game_v2::collisionsBlock (this=0x8291000)
at engines/gob/game_v2.cpp:899
#27 0x28c6469d in Gob::Inter::callSub (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:272
#28 0x28c66c1c in Gob::Inter_v1::o1_callSub (this=0x82fbc00,
params=@0xbfbfe00c) at engines/gob/inter_v1.cpp:1154
#29 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=1 '\001', params=@0xbfbfe00c) at engines/gob/inter_v2.cpp:680
#30 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=1)
at engines/gob/inter.cpp:242
#31 0x28c67034 in Gob::Inter_v1::o1_repeatUntil (this=0x82fbc00,
params=@0xbfbfe0ac) at engines/gob/inter_v1.cpp:1230
#32 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=6 '\006', params=@0xbfbfe0ac) at engines/gob/inter_v2.cpp:680
#33 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:242
#34 0x28c64665 in Gob::Inter::callSub (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:270
#35 0x28c4730f in Gob::Game_v2::playTot (this=0x8291000, skipPlay=-1)
at engines/gob/game_v2.cpp:219
#36 0x28c3f462 in Gob::Game::totSub (this=0x8291000, flags=2 '\002',
newTotFile=0xbfbfe210 "gob06") at engines/gob/game.cpp:501
#37 0x28c7173b in Gob::Inter_v2::o2_totSub (this=0x82fbc00)
at engines/gob/inter_v2.cpp:1136
#38 0x28c6f5b2 in Gob::Inter_v2::executeDrawOpcode (this=0x82fbc00, i=64 '@')
at engines/gob/inter_v2.cpp:663
#39 0x28c68f09 in Gob::Inter_v1::o1_drawOperations (this=0x82fbc00,
params=@0xbfbfe2ec) at engines/gob/inter_v1.cpp:1719
#40 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00,
i=1 '\001', j=14 '\016', params=@0xbfbfe2ec)
at engines/gob/inter_v2.cpp:680
#41 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=1)
at engines/gob/inter.cpp:242
#42 0x28c67034 in Gob::Inter_v1::o1_repeatUntil (this=0x82fbc00,
params=@0xbfbfe38c) at engines/gob/inter_v1.cpp:1230
#43 0x28c6f6e3 in Gob::Inter_v2::executeFuncOpcode (this=0x82fbc00, i=0 '\0',
j=6 '\006', params=@0xbfbfe38c) at engines/gob/inter_v2.cpp:680
#44 0x28c64549 in Gob::Inter::funcBlock (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:242
#45 0x28c64665 in Gob::Inter::callSub (this=0x82fbc00, retFlag=2)
at engines/gob/inter.cpp:270
#46 0x28c4730f in Gob::Game_v2::playTot (this=0x8291000, skipPlay=0)
at engines/gob/game_v2.cpp:219
#47 0x28c3f113 in Gob::Game::start (this=0x8291000) at engines/gob/game.cpp:451
#48 0x28c62ef6 in Gob::Init::initGame (this=0x82673a0, totName=0x0)
at engines/gob/init.cpp:192
#49 0x28c4ece2 in Gob::GobEngine::go (this=0x827d400)
at engines/gob/gob.cpp:119
#50 0x0808c572 in runGame (plugin=0x827d800, system=@0x818a000,
edebuglevels=@0xbfbfe850) at base/main.cpp:202
#51 0x0808cc57 in scummvm_main (argc=4, argv=0xbfbfe928) at base/main.cpp:297
#52 0x08089bc4 in main (argc=4, argv=0xbfbfe928)
at backends/platform/sdl/sdl.cpp:121

comment:7 Changed 12 years ago by sev-

Priority: normalblocker

comment:8 Changed 12 years ago by sev-

Raising priority. This is a release-critical bug.

comment:9 Changed 12 years ago by DrMcCoy

Could you give me a save from a point right before entering music land?

Changed 12 years ago by spookypeanut

Attachment: gob2cd.s14 added

savegame from just before music land

comment:10 Changed 12 years ago by spookypeanut

File Added: gob2cd.s14

comment:11 Changed 12 years ago by DrMcCoy

Hmm, three things I found out (after a futile wild goose chase):
1) There are versions that behave correctly and versions that don't
2) The bug happens a bit before. When one goblin drinks the fluid, var_4344 should be decreased by 32 (var_4344 is used to "mask out" the unselectable buttons and the fifth bit is the MOVEMENT button) but isn't
3) Incorrectly behaving versions behave incorrectly in dosbox as well. The "var_4344 = var_4344 - 32" line is literally missing in the scripts of these versions.

So it's a script bug and I can't really fix it. :/
The only thing I can do (and did) is to add a workaround. You'll get a "I confirm" dialog when trying to use the MOVEMENT menu now, but that shouldn't create any problems.

Could you try if it works for you too?

comment:12 Changed 12 years ago by spookypeanut

Hmmm, very odd. I will check this when I get home, and I'll also re-check dosbox behaviour. I'm sure that running my version (from the 2CD gob1&2 sierra double pack) in dosbox doesn't crash, and in scummvm does. I'll make absolutely sure I'm using the same files in both (tho I only have the one copy of gob2!). If there's something I can try out, even if it involves gdb (shivers), let me know.

comment:13 Changed 12 years ago by spookypeanut

Yes, your workaround works (stops the seg fault). It doesn't affect the MOVEMENT icon not working after musicland, as mentioned in my second comment to this bug.

Re-checked dosbox, and my version works correctly there: maybe they added a workaround when they re-released it? The MOVEMENT icon doesn't even highlight there.

comment:14 Changed 12 years ago by fingolfin

Since a workaround is in place, could we lower the priority from "release critical" to "would be nice to fix" again?

comment:15 Changed 12 years ago by spookypeanut

From my pov yes. I don't know what drmccoy's progress with this has been, but it doesn't segfault anymore so it's releasable.

comment:16 Changed 12 years ago by sev-

Lowering priority,

comment:17 Changed 12 years ago by sev-

Priority: blockernormal

comment:18 Changed 12 years ago by sev-

Sven, do you think we may just close this bugreport?

comment:19 Changed 12 years ago by DrMcCoy

Well, there's a workaround, but it's not "properly" fixed... I'll lower the priority.

comment:20 Changed 12 years ago by DrMcCoy

Priority: normallow

comment:21 Changed 10 years ago by sev-

Keywords: original added

comment:22 Changed 10 years ago by spookypeanut

Was there a discussion that led to this being marked "Also occurs in the original"? Because it didn't when I tried it (which admittedly was over a year ago now).

comment:23 Changed 10 years ago by spookypeanut

OK, I've reverted this from "Also occurs in the original".
As I understand it, and it's over a year since I investigated so I'm willing to be corrected:
On the tree screen, after completing music world:
The MOVEMENT icon on the drop-down toolbar does not do anything in ScummVM. In the original game, it allows you to choose the only other place available, the castle.
(IIRC, the behaviour of ScummVM differed from original interpreter in music land too, but the above is the better and more obvious example).
I'll attach a savegame at the place described above too.

comment:24 Changed 10 years ago by spookypeanut

Keywords: original removed

Changed 10 years ago by spookypeanut

Attachment: gob2cd.s02 added

savegame from tree screen, having completed music land

comment:25 Changed 10 years ago by DrMcCoy

Hmmkay, so it isn't completely a script bug? Now I'm a bit confused, because for me, at least a part does happen in the original. The MOVEMENT icon in music land crashes the game for me in the original, because necessary initialization is missing in the scripts leading to a jump into a random place in the scripts.

comment:26 Changed 10 years ago by spookypeanut

Interesting... what version are you using? 1.02 does what I said. So maybe it was originally a script bug that was worked around in later release.

comment:27 Changed 10 years ago by sev-

Status: newclosed

comment:28 Changed 10 years ago by sev-

This bugreport has been moved to Wiki to relevant Engine/TODO page. When the bug will be resolved, an appropriate message will be posted here and the bugreport link removed from Wiki

Note: See TracTickets for help on using tickets.