Segfault if you watch the whole cut scene - it works if you skip or ESC out of it.

Issue #198 new
Misanthopos created an issue

Just FF the attached savegame and the cut scene will start.

Comments (9)

  1. Former user Account Deleted

    same issue here. for every cutscene i watched until the end, by the way. gdb:

    (gdb) run
    ...
    Program received signal SIGSEGV, Segmentation fault.
    0x000000000053b39b in HandleDialogue() ()
    (gdb) info stack
    0  0x000000000053b39b in HandleDialogue() ()
    1  0x00000000004c8e8e in MapScreenHandle() ()
    2  0x0000000000448189 in GameLoop() ()
    3  0x00000000006ada17 in MainLoop(int) ()
    4  0x00000000006ae1cd in main ()
    

    doesn't say that much except it's in HandleDialogue() ().

  2. Former user Account Deleted

    v2 - now with DEBUGINFO

    (gdb) r -res 1920x920
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    
    [New Thread 0x7ffff484d700 (LWP 25481)]
    [New Thread 0x7fffed3e0700 (LWP 25482)]
    [Thread 0x7fffed3e0700 (LWP 25482) exited]
    [New Thread 0x7fffed3e0700 (LWP 25483)]
    
    Program received signal SIGSEGV, Segmentation fault.
    0x000000000053b39b in HandleDialogue () at Build/Tactical/Dialogue_Control.cc:449
    449     if (gTacticalStatus.fAutoBandageMode || !d->Execute())
    (gdb) backtrace
    #0  0x000000000053b39b in HandleDialogue () at Build/Tactical/Dialogue_Control.cc:449
    #1  0x00000000004c8e8e in MapScreenHandle () at Build/Strategic/MapScreen.cc:1974
    #2  0x0000000000448189 in GameLoop () at Build/GameLoop.cc:299
    #3  0x00000000006ad9fb in MainLoop (msPerGameCycle=25) at sgp/SGP.cc:252
    #4  0x00000000006ae1b1 in main (argc=3, argv=0x7fffffffe118) at sgp/SGP.cc:516
    (gdb) 
    
  3. Former user Account Deleted

    OK, the problem definitly is that d->Execute() is not a valid pointer. Tried this for example:

        if (gTacticalStatus.fAutoBandageMode || (d && !d->Execute()))
    

    the game doesn't crash anymore but when i get back to strategic, the lower panel (time ctl, laptop access, etc.) is grayed out and i cannot start time compression or anything. Options are also unavailable so there is no way out of this situation except killing the game yourself.

    what i did observe too is, if you ESC out of the cutscene, HandleDialogue() isn't called. If you watch it to the end, it is. Looking into the reason for that right now.

    EDIT1: OK, maybe it is called, but is doesn't get to this line 446:

        DialogueEvent*const d = ghDialogueQ.front();
    

    (i set a breakpoint there, didn't hit when ESC out of the cutscene) So, possibly, HandleDialogue() is called, but the Queue is empty and the functions returns beforehand. Irritating to me right now is, if d->Execute() is not a valid pointer, d quite obviously is NULL itself, so the queue was empty before ghDialogueQ.front() was called. But if it would be, HandleDialogue() would catch that and return before trying to obtain d...

  4. Jaka Kranjc

    Memory corruption occurs (invalid reads), so you're lucky if you're always getting NULLs. It's due to the recent refactoring, but I should have more details tomorrow.

    Trivial to reproduce — first cutscene after contacting the rebels.

  5. Jaka Kranjc

    Eh, I give up — couldn't pinpoint the true cause. From valgrind I suspect the problem is that the plethora of DialogEvent child classes have no default constructor and the uninitialised values come from there. Immediately popping on null d got me into tactical just fine, but then a different loop calls it again just when you think you're safe.

    For the interim, you can just "git revert f17000ca3" and follow the instructions (conflict).

  6. ardor-ja2s-wvxx-zkfu-eka83

    Think I got this one, but it may be more of a workaround than a true fix. Uploaded fix198 branch if you would like to try it.

  7. Former user Account Deleted

    i can't find your solution. no branch in this repo, no pull request and i can't access your profile...

  8. Log in to comment