Menu

#5862 AGOS: Deadlock when quitting Waxworks demo

Waxworks
open
kirben
7
2011-10-20
2011-10-06
No

ScummVM revision 833c692fc96820a47da4ec4068517a85cafb8fc0
Linux/PowerPC (32bit)
g++ 4.6.1

Sound driver: AdLib
Demo from our demos page.

When exiting the Waxworks Demo at the Accolade logo (via closing the Window) I got a deadlock.

I attached the backtraces for the main thread and the sound thread as files.

Discussion

  • Johannes Schickel

    Main thread backtrace

     
  • Johannes Schickel

    Sound thread backtrace

     
  • digitall

    digitall - 2011-10-07

    This looks like an issue I had with an engine I was working on.
    It occurs when you try to destruct the midiPlayer/midiDriver while the midiDriver is still assigned to the timerCallback of the player and causes sporadic issues at quit i.e. if the callback is running and locks the mutex..
    The code in audio/midiplayer.cpp line 45 i.e. default implementation indicates that it is expected for the destructor of a midiPlayer to unhook the callback prior to driver deletion and player destruction.

     
  • digitall

    digitall - 2011-10-07

    I have looked at the AGOS code and this seems likely to be the cause.
    Kirben is going to commit a correction, but hard to know if this is "fixed" as the problem is not reliably replicable anyway.

    Lordhoto: It should be noted that all other engines in tree should be quickly reviewed by grep to check that their midiPlayer implementations do unhook the callback in their destructors otherwise they wil likely be affected by similar issues.

     
  • Eugene Sandulenko

    • priority: 5 --> 7
     
  • Eugene Sandulenko

    This bug is nice to get fixed before the release. Raising priority for keeping the track.

     
  • digitall

    digitall - 2011-10-21

    sev-: Kirben has already committed a correction as d5a763b763a39dbd0873f7eb6e17105a9b1cc958. However, it is not east to test that this is fixed as I indicated earlier i.e. "hard to know if this is "fixed" as the problem is not reliably replicable anyway."

    However, the bug was also left open on reviewing the other engines for failure to unhook the MidiDriver timer callbacks. A cursory grep seems to indicate that AGI, CGE, Draci, Hugo, M4, MADE, Parallaction, Prisoner, SAGA, SCI. Tinsel and Touche may need corrections to their MIDIPlayer destructors i.e. missing _driver->setTimerCallback(NULL, NULL); or similar prior to _driver deletion?

     
  • Johannes Schickel

    I was able to reproduce another dead lock in the MIDI code with the recent master in Simon 2. I tried to quit ScummVM via the window close button when the closet appeared in Simon's room in the intro when the deadlock happend.

    I attached backtraces from the main and audio thread.

     
  • Johannes Schickel

     
  • Johannes Schickel

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.