Opened 13 years ago

Closed 10 years ago

#5705 closed defect (fixed)

SCI: PQ1VGA - Crash at the gun locker

Reported by: SF/kuroshiro Owned by: m-kiewitz
Priority: normal Component: Engine: SCI
Version: Keywords: original
Cc: Game: Police Quest 1


Police Quest I: In Pursuit of the Death Angel (VGA Remake/DOS/English) ScummVM 1.4.0git441-g16a0d8e Windows 7 x64

At the jail, when you put your gun in the sidearms locker, if you quickly click a second time after placing the gun in, the game will crash with the error: ERROR: lookupSelector(): Attempt to send to non-object or invalid script. Address was 0000:0000.

It's not a huge problem, as it can be avoided easily enough by simply not clicking a second time.

Ticket imported from: #3303802. Ticket imported from: bugs/5705.

Attachments (1)

pq1sci.004 (45.3 KB ) - added by SF/kuroshiro 13 years ago.
save at the sidearms locker

Download all attachments as: .zip

Change History (15)

by SF/kuroshiro, 13 years ago

Attachment: pq1sci.004 added

save at the sidearms locker

comment:1 by digitall, 13 years ago

Owner: set to bluegr

comment:2 by digitall, 13 years ago

This bug report is a duplicate of bug #3036933 : "PQ1VGA : Engine Abort When Putting Away Gun at Jail"

This was closed without being fixed as a minor bug to be dealt with later.

thebluegr: Could you take a look again at this one?

comment:3 by bluegr, 13 years ago

Fixed in rev 48140a0

comment:4 by bluegr, 13 years ago

Keywords: script added
Resolution: fixed
Status: newclosed

comment:5 by lskovlun, 13 years ago

Resolution: fixedduplicate

comment:6 by lskovlun, 13 years ago

This is a rather bad fix, as it can cause heisenbugs in just about all other SCI games. Moreover, it potentially "taints" all savegames made with this revision. Please revert!

comment:7 by lskovlun, 13 years ago

Status: closednew

comment:8 by bluegr, 13 years ago

The buggy script in question is 937

comment:9 by wjp, 13 years ago

Resolution: duplicate

comment:10 by bluegr, 13 years ago

A slight update on this:

The crash happens in script 937, as mentioned, inside IconBar::handleEvent. Here's part of the script function in question:

code_0701: push1 pTos curIcon callk IsObject, $2 <----- check the current icon bnt code_0733 pushi $1f ; 31, type push1 pushi $1f ; 31, type push0 pToa curIcon send $4
push pushi $25 ; 37, '%', message push1 pTos curIcon pToa useIconItem eq? bnt code_0727 pushi $25 ; 37, '%', message push0 pToa curInvIcon <-------- crash! send $4 jmp code_072e

This is fairly standard code in many SCI games. The crash occurs because the inventory object is destroyed with the first click, so when clicking the second time, the code will attempt to check it again and crash.

This is a racing condition: after clicking the first time to place the weapon, the locker screen should close, however it remains functional for some seconds, which is why the crash occurs.

IMHO, the correct way to resolve this would be to either remove the delay after the gun is placed, and close the locker screen immediately, or disable any actions on the locker after the gun is placed.

comment:11 by bluegr, 11 years ago

Summary: SCI: PQ1VGA - Crash at the jailSCI: PQ1VGA - Crash at the gun locker

comment:12 by m-kiewitz, 10 years ago

Keywords: original added; script removed
Owner: changed from bluegr to m-kiewitz
Resolution: fixed

comment:13 by m-kiewitz, 10 years ago

finally fixed today by ed865856dc1b486c52e0a22ae6d39f686e9a79ab

comment:14 by m-kiewitz, 10 years ago

Status: newclosed
Note: See TracTickets for help on using tickets.