Menu

#5705 SCI: PQ1VGA - Crash at the gun locker

SCI: Police Quest 1
closed-fixed
5
2013-09-17
2011-05-18
No

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.

Discussion

  • Ethan Sherr-Ziarko

    save at the sidearms locker

     
  • digitall

    digitall - 2011-05-18
    • assigned_to: nobody --> thebluegr
     
  • digitall

    digitall - 2011-05-18

    This bug report is a duplicate of bug #3036933 : "PQ1VGA : Engine Abort When Putting Away Gun at Jail"
    https://sourceforge.net/tracker/?func=detail&aid=3036933&group_id=37116&atid=418820

    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?

     
  • Filippos Karapetis

    Fixed in rev 48140a0

     
  • Filippos Karapetis

    • labels: 415217 --> 415215
    • status: open --> closed-fixed
     
  • Lars Skovlund

    Lars Skovlund - 2011-05-27

    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!

     
  • Lars Skovlund

    Lars Skovlund - 2011-05-27
    • status: closed-fixed --> closed-duplicate
     
  • Lars Skovlund

    Lars Skovlund - 2011-05-27
    • status: closed-duplicate --> open-duplicate
     
  • Filippos Karapetis

    The buggy script in question is 937

     
  • Willem Jan Palenstijn

    • status: open-duplicate --> open
     
  • Filippos Karapetis

    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.

     
  • Filippos Karapetis

    • summary: SCI: PQ1VGA - Crash at the jail --> SCI: PQ1VGA - Crash at the gun locker
     
  • M. Kiewitz

    M. Kiewitz - 2013-09-17
    • assigned_to: thebluegr --> m_kiewitz
    • labels: 415215 --> Also occurs in the original
    • status: open --> open-fixed
     
  • M. Kiewitz

    M. Kiewitz - 2013-09-17

    finally fixed today by ed865856dc1b486c52e0a22ae6d39f686e9a79ab

     
  • M. Kiewitz

    M. Kiewitz - 2013-09-17
    • status: open-fixed --> closed-fixed