morerokk / IreNFist

A continuation/fix of the IreNFist mod for PAYDAY 2
MIT License
4 stars 2 forks source link

Crash after dominated a cop #82

Closed ghost closed 3 years ago

ghost commented 3 years ago

Current thread: Main Script stack: _add_delayed_rescue_SO() lib/units/enemies/cop/logics/coplogicintimidated.lua:461
on_rescue_allowed_state() lib/units/enemies/cop/logics/coplogicintimidated.lua:628
on_rescue_allowed_state() lib/units/enemies/cop/copbrain.lua:759
_set_rescue_state() lib/managers/group_ai_states/groupaistatebase.lua:4107
_end_regroup_task() lib/managers/group_ai_states/groupaistatebesiege.lua:801
_upd_regroup_task() lib/managers/group_ai_states/groupaistatebesiege.lua:824
clbk() lib/managers/group_ai_states/groupaistatebesiege.lua:182
_execute_queued_task() @mods/IRE
AND
FIST
REBORN/lua/enemymanager.lua:83 _update_queued_tasks()
@mods/IRE
AND
FIST REBORN/lua/enemymanager.lua:36
update() lib/managers/enemymanager.lua:51
update() lib/setups/gamesetup.lua:723
update() lib/setups/networkgamesetup.lua:21
core/lib/setups/coresetup.lua:557

morerokk commented 3 years ago

That's odd. And the top line is just "access violation" right?

This is probably some weird one-off crash. I've had this before and I don't think I can actually fix it. In fact, it might not even be related to InF - it shows up in the stacktrace but that's only because InF touches the enemy task update loop.

Has this only happened once or does it happen every time? If it happens more often I can add special debugging for it.

ghost commented 3 years ago

Yes, it is. It looks like this has happened twice for me. Here's another one: Wed Oct 14 17:15:36 2020

Application has crashed: access violation


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
                       ???  (???)     ???                                                 
                       ???  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
                       ???  (???)     ???                                                 
                       ???  (???)     ???                                                 
     payday2_win32_release  (???)     zip_get_name                                        

Current thread: Main Script stack: on_new_objective() lib/units/enemies/cop/logics/coplogicbase.lua:412
on_new_objective() lib/units/player_team/logics/teamailogicbase.lua:66
on_new_objective() lib/units/player_team/logics/teamailogicidle.lua:478
set_objective() lib/units/enemies/cop/copbrain.lua:265
origfunc() lib/managers/group_ai_states/groupaistatebase.lua:3324
objective_complete_clbk() @mods/The
Fixes/groupaistatebase.lua:7
clbk()
lib/units/enemies/cop/logics/coplogicidle.lua:971 _update_queued_tasks()
@mods/IRE
AND
FIST REBORN/lua/enemymanager.lua:62
update() lib/managers/enemymanager.lua:51
update() lib/setups/gamesetup.lua:723
update() lib/setups/networkgamesetup.lua:21
core/lib/setups/coresetup.lua:557


Judging from the time skip, this crash is quite rare. But I'm not sure why this happens either. There's The Fixes mod from this crash log, but I already prevented that crash from the mod options.

morerokk commented 3 years ago

Well it's rare maybe, but the next build will have a debug function that should reveal where the issue is. Just enable the Debug option and this crash log will become clearer.

Thanks for bringing this to my attention!

morerokk commented 3 years ago

I added more debug logging, if this happens again upload a new crash report and I'll do my best to take preventative measures.

ghost commented 3 years ago

Fri Nov 06 20:09:05 2020

Application has crashed: access violation


Callstack:

     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
                       ???  (???)     ???                                                 
                       ???  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     ???                                                 
     payday2_win32_release  (???)     zip_get_name                                        

Current thread: Main Script stack: CheckClientMeleeDamageArrest() @mods/IRE
AND
FIST
REBORN/utils/coputils.lua:74 complete_clbk()
@mods/IRE
AND
FIST REBORN/utils/coputils.lua:268
objective_complete_clbk() lib/managers/group_ai_states/groupaistatebesiege.lua:1810
_on_destination_reached() lib/units/enemies/cop/logics/coplogictravel.lua:1467
upd_advance() lib/units/enemies/cop/logics/coplogictravel.lua:264
clbk() lib/units/enemies/cop/logics/coplogictravel.lua:194
_execute_queued_task() @mods/IRE
AND
FIST
REBORN/lua/enemymanager.lua:83 _update_queued_tasks()
@mods/IRE
AND
FIST REBORN/lua/enemymanager.lua:36
update() lib/managers/enemymanager.lua:51
update() lib/setups/gamesetup.lua:723
update() lib/setups/networkgamesetup.lua:21
core/lib/setups/coresetup.lua:557


ghost commented 3 years ago

To narrow it down, this crash seems to happen (frequently) in Hoxton Breakout Day 1, in the parking lot. I think I got three crashes in the same heist and area now. I thought it may be only related to clients getting cuffed, but I tried playing online in other heists, and clients got cuffed without crashes whatsoever.

However, the first crash log occurred in Alaskan Deal and while playing on Offline mode.

morerokk commented 3 years ago

This crash seems to be unrelated to the first one, this has more to do with the cop somehow being unable to complete their "arrived at arrest position" callback. I can add more checks here but this really does just seem like the game itself oof'ing for no reason.

The problem is that this is in some sort of weird complete_clbk which I can't touch or view in Lua properly.

morerokk commented 3 years ago

Just for clarity's sake, here's the line it crashed on: https://github.com/HugoZink/IreNFist/blob/master/IRE%20AND%20FIST%20REBORN/utils/coputils.lua#L74

I added as many crash guard checks as possible already, but it still crashed. The only thing I can think of is that the client disconnected right before the cop arrived at their position. I'll add an extra check for that there, just in case. Thanks for helping me hammer out these edge cases!

morerokk commented 3 years ago

This should be fixed now.