Dungeon Crawl Stone Soup Tracker - DCSS
Viewing Issue Advanced Details
9137 Bug Report crash have not tried 2014-11-05 12:17 2016-04-15 11:51
Karagy Remote  
neil CAO  
normal Console  
closed 0.15 ancient branch  
0.15.2 done  
none    
none 0.16 ancient branch  
0009137: Frenzied Duvessa and Dowan crash
CAO ssh console, 0.15.2 at 20141105, near 13:30 GMT.

First turn, I hit Duvessa by Needle of Frenzy (NoF), and she start fight against Dowan.
Second turn, I shoot NoF to Dowan, but game session on CAO ssh imediatly closes to main CAO screen.
I.e. I don't known - Dowan sucessfuly frenzied or not.

After 5-10 sec the game session been auto-recowered at time before frenzing Duvessa.
I tried to reproduce this crash. Apply frenzy to Duvessa, but missed beside the Dowan. And Dowan will be killed by Duvessa at this turn w/o any crashes.
? file icon 0001-Prevent-infinite-recursion-via-frenzied-twins.patch [^] (9,589 bytes) 2015-02-01 01:46 [Show Content]
Issue History
2014-11-05 12:17 Karagy New Issue
2015-01-03 03:52 neil Note Added: 0028212
2015-01-03 03:53 neil Note Edited: 0028212
2015-01-27 07:10 Zannick Note Added: 0028370
2015-01-27 07:15 Zannick Note Added: 0028371
2015-02-01 01:46 Zannick Note Added: 0028416
2015-02-01 01:46 Zannick File Added: 0001-Prevent-infinite-recursion-via-frenzied-twins.patch
2015-03-01 22:23 neil Note Added: 0028585
2015-03-01 22:23 neil Status new => resolved
2015-03-01 22:23 neil Fixed in Branch => 0.16 development branch
2015-03-01 22:23 neil Resolution open => done
2015-03-01 22:23 neil Assigned To => neil
2016-04-15 11:51 Karagy Status resolved => closed

Notes
(0028212)
neil   
2015-01-03 03:52   
(edited on: 2015-01-03 03:53)
The logs don't show a crash milestone (and your directory doesn't have any crash dumps since 2010), so I wonder if something funny happened to your connection.... But that should have saved, not reverted you.

(0028370)
Zannick   
2015-01-27 07:10   
Reproduced in wizmode, got a segfault and a stack trace. There's an infinite recursion here (the crash dump probably didn't work since there was no stack space):

mon.behv.cc:behaviour_event:1216
        if (src == &you
            && !mon->has_ench(ENCH_INSANE)
            && !mons_is_avatar(mon->type)
            && mon->type != MONS_SPELLFORGED_SERVITOR)
        {
            mon->attitude = ATT_HOSTILE;
            breakCharm = true;
        }

        // XXX: Somewhat hacky, this being here.
        if (mons_is_elven_twin(mon))
            elven_twins_unpacify(mon);

mon-death.cc:elven_twins_unpacify:3400
    behaviour_event(mons, ME_WHACK, &you, you.pos(), false);

That check in behaviour_event is what sets neutral monsters hostile when you attack them, but not for insane monsters. And since putting monsters into a frenzy makes them neutral first, the game goes into a mutual recursion with Down and Duvessa each telling the other about the WHACK notification they just received.

I solved this by adding to the "is not neutral" check in elven_twins_unpacify to also skip insane monsters. The twins should probably also have their old_attitude set to ATT_HOSTILE when frenzied so that if both are pacified, you can't frenzy one (making the other hostile) and let them revert to neutral when frenzy wears off (as then one would still be neutral while the other is hostile).

I thought about moving the "hacky" call into the if block above, but I'm not sure what that would affect...
(0028371)
Zannick   
2015-01-27 07:15   
Oh, and when they were both frenzied and attacking each other, Duvessa didn't scream or anything when Dowan died. I'm not sure why...
(0028416)
Zannick   
2015-02-01 01:46   
Figured that out, too. Turns if you frenzy one twin and kill them, the other becomes pacified, because it thinks it occurred in the case where you pacified one of them on the stairs (so the death message is skipped). Oops! This patch fixes that as well.
(0028585)
neil   
2015-03-01 22:23   
Zannick's patch is applied in trunk (0.16-a0-4120-gb205902), thanks!