segabl / pd2-useful-bots

A lightweight bot overhaul
GNU General Public License v3.0
8 stars 6 forks source link

coplogictravel.lua crash with unknown reason #11

Closed ghost closed 1 year ago

ghost commented 1 year ago

Another one I can't seem to reproduce. Happened on one of the window roofs on The Bomb: Dockyard when I told the bot to stay still. I noticed I see no mention of this being caused by the mod, but I have no other mods that modify coplogictravel.lua.

Crash Log:

----------------------------------------------------------------------

Wed Jan 11 01:46:15 2023

Application has crashed: C++ exception
[string "lib/units/enemies/cop/logics/coplogictravel.lua"]:1581: attempt to index a nil value

SCRIPT STACK

update() lib/units/enemies/cop/logics/coplogictravel.lua:235
lib/units/enemies/cop/copbrain.lua:234

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        
                         ntdll  (???)     RtlDosSearchPath_Ustr                               
                         ntdll  (???)     RtlRestoreLastWin32Error                            
                         ntdll  (???)     ZwQueryVirtualMemory                                
                    KERNELBASE  (???)     VirtualQueryEx                                      
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.165
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2802]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
segabl commented 1 year ago

Hard to say what went wrong there, potentially less chance to happen in the next version

ghost commented 1 year ago

Yeah, when looking in that lua's code I was worried it's one of those hard-to-reproduce, hard-to-understand ones. If I get another one of these, I'll attach it here with any observation I can.

ghost commented 1 year ago

Got another one of these on Lost in Transit. The crash log is slightly different under "callstack" this time. Didn't notice anything specific happen, but I wasn't looking at the bots as it crashed.

----------------------------------------------------------------------

Thu Jan 12 00:38:22 2023

Application has crashed: C++ exception
[string "lib/units/enemies/cop/logics/coplogictravel.lua"]:1581: attempt to index a nil value

SCRIPT STACK

update() lib/units/enemies/cop/logics/coplogictravel.lua:235
lib/units/enemies/cop/copbrain.lua:234

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        
                         ntdll  (???)     RtlAllocateHeap                                     

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.165
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2802]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
segabl commented 1 year ago

were they stopped or following?

ghost commented 1 year ago

I think the two bots that were each following a different player (I can't be sure since my memory is crap). I'm also getting a suspicion that it's heist specific. When I have the time, I'll replay those two heists and see if it happens again.

segabl commented 1 year ago

Any other AI related mods?

ghost commented 1 year ago

I don't think any do, but I'll send a list just in case.

All my BLT-mods:

ghost commented 1 year ago

I have also gotten around now to testing the two heists one more time, and while it has crashed on Lost in Transit again, producing the same crash log, I haven't had it crash on The Bomb: Dockyard. That does suggest to me that there's at least something specific to Lost in Transit that's crashing it. Maybe same issue, but just one that occurs more often on that heist?

Crash Log:

----------------------------------------------------------------------

Thu Jan 12 21:59:55 2023

Application has crashed: C++ exception
[string "lib/units/enemies/cop/logics/coplogictravel.lua"]:1581: attempt to index a nil value

SCRIPT STACK

update() lib/units/enemies/cop/logics/coplogictravel.lua:235
lib/units/enemies/cop/copbrain.lua:234

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        
                         ntdll  (???)     RtlAllocateHeap                                     

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.167
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2802]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
segabl commented 1 year ago

when and where on the map did this occur approximately?

ghost commented 1 year ago

Both times in Lost in Transit, it happened as we were running around opening the train carts, so I'm guessing in, on, under or around those. Maybe the train carts near the building labelled "warehouse" in preplanning? I have a hard time saying specifics since I usually encounter these when just playing with friends. I guess next time I play that heist, I'll record it.

On The Bomb: Dockyard, I still remember the exact spot. It happened on top of the window-roof-thingy (no idea what they're called) as I told the bot to stop thought that might not help as when I've tried it again, nothing happened. I've marked exactly which one on the image below. image

ghost commented 1 year ago

Tried Lost in Transit again, crashed again, different callstack this time that looks the same as the one in my first crash on The Bomb: Dockyard. I also recorded it, so I'll give a link to the last minute of what happened. I definitely had other crashes where no one was downed when it crashed, and the first crash also had nothing to do with being downed. Of note to me is also that the bots refused to move at first, so I tried to open the door using leach, but before I even got it open Hoxton started moving as if I was still downed.

Video of crash:

https://www.youtube.com/watch?v=dThdUxsx7Sk

Crash log:

----------------------------------------------------------------------

Fri Jan 13 21:59:16 2023

Application has crashed: C++ exception
[string "lib/units/enemies/cop/logics/coplogictravel.lua"]:1581: attempt to index a nil value

SCRIPT STACK

update() lib/units/enemies/cop/logics/coplogictravel.lua:235
lib/units/enemies/cop/copbrain.lua:234

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        
                         ntdll  (???)     RtlDosSearchPath_Ustr                               
                         ntdll  (???)     ZwQueryVirtualMemory                                
                    KERNELBASE  (???)     VirtualQueryEx                                      
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.167
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2802]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
segabl commented 1 year ago

Hm, these seem quite different to the ones I have encountered which should be fixed with the upcoming version. No idea what exactly causes it but I hope its a similar issue that will also be fixed with the new version. currently the hold objective is a bit hacky since bots are technically not allowed to move when stopped and hold point forces the objective through anyways.

segabl commented 1 year ago

you may want to try the upcoming version and check if this one still crashes you

ghost commented 1 year ago

Oh, a version you haven't pushed though yet? Sure, I'll play with it until the next update and try Lost in Transit again. I have started now recording my gameplay in general, specifically for these bug reports. Hopefully that helps with these obscure issues.

ghost commented 1 year ago

I have managed to successfully complete a single playthrough in every heist I've ever encountered a bug with the mod in (Lost in Transit, The Bomb: Dockyard, Reservoir Dogs, Mountain Master and San Martin Bank) without encountering this crash again. Before I call this issue closed, I will do another run through each and maybe a third in Lost in Transit just for good measure.

Sadly, during that I've encountered a new crash and some bugs I think are related to the version you sent here. I'll have to make separate issue threads for those.

ghost commented 1 year ago

Okay, I've done the play-testing I wanted to, and I can report back that this crash doesn't seem to happen at all any more. With that, I feel confident enough to call this issue fixed.

segabl commented 1 year ago

I finally had this happen so I'm gonna try and reproduce. Were all the instances of it happening to you in multiplayer sessions with other people?

segabl commented 1 year ago

if you could put the contents of this file at the top of useful bots own coplogictravel, that would help me figure out whats causing it easier coplogictravel.zip

ghost commented 1 year ago

Were all the instances of it happening to you in multiplayer sessions with other people?

Yes. I don't really ever play alone, so you can assume most of my issue reports involve multiplayer sessions.

Though the problem is, this crash is no longer happening to me since version 2.3.0, so it's likely the one you've encountered is a different one involving the same lua file. Should I still put in the coplogictravel.zip you've sent either way?

If yes, just wanna double check I understood correctly. Does "at the top" mean that I should replace the file with the one you provided, or insert the code of it at the top of the lua file I have?

segabl commented 1 year ago

it's weird cause I got the exact same crash today when playing with a friend. so my assumption is that it's either not happening in solo or not happening in my overhaul (streamlined heisting). I did have some assumptions about what might be causing it though in the meantime so adding the thing i sent shouldn't be necessary anymore. I'll keep this open though until I can confirm the latest change fixed it for good.

ghost commented 1 year ago

I can only tell you that I no longer get seemingly random coplogictravel.lua crashes, I don't have your streamlined heisting mod and nothing besides your update 2.3.0 is changed in my game.

Though I obviously haven't replayed every single heist so maybe it's still an issue on specific ones.

ghost commented 1 year ago

If you find what heist does it most often this time, I can do a few playthroughs of it to see if it can be replicated on a different setup.

segabl commented 1 year ago

Like I said it should hopefully be fine now so no reason to try and reproduce it, I didn't manage to reproduce it in 2 hours

ghost commented 1 year ago

I'm just a bit confused cause it happened for you after I confirmed it fixed on my end.

segabl commented 1 year ago

yeah weird, isn't it. the joy of hard to reproduce crashes

ghost commented 1 year ago

Yep, okay, maybe it's not fixed. Was entering the escape zone on Stealing Xmas and it crashed. Tried to replay the heist, and it didn't happen again. Maybe it's a hold issue, like in #18 since I didn't test that yet, but I'm sure the bot was in follow mode. I'll double-check if it could be that later, this one kinda pissed me off.

Crash Log:

----------------------------------------------------------------------

Fri Jan 20 21:50:59 2023

Application has crashed: C++ exception
[string "lib/units/enemies/cop/logics/coplogictravel.lua"]:1581: attempt to index a nil value

SCRIPT STACK

update() lib/units/enemies/cop/logics/coplogictravel.lua:235
lib/units/enemies/cop/copbrain.lua:234

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        
                         ntdll  (???)     RtlDosSearchPath_Ustr                               
                         ntdll  (???)     RtlRestoreLastWin32Error                            
                         ntdll  (???)     ZwQueryVirtualMemory                                
                    KERNELBASE  (???)     VirtualQueryEx                                      
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
                    KERNELBASE  (???)     SetUnhandledExceptionFilter                         
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_get_name                                        

-------------------------------

Current thread: Main

-------------------------------

System information:
    Application version : 1.134.167
    CPU : 12th Gen Intel(R) Core(TM) i7-12700K (10 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1; SSE4.2
    DirectX : 12.0 
    GPU : NVIDIA GeForce RTX 3070 Ti / nvldumd.dll[31.0.15.2802]
    Language : english
    Memory :     32538MB 116KB
    OS : 6.2.9200 () 0x300-0x1 (64 bits)
    Physics : threaded
    Renderer : DX9 threaded
    Sound : Razer Inc. (Headphones (Razer Nari - Game))
segabl commented 1 year ago

and that's with the current version? that should list a different callstack at least, weird

ghost commented 1 year ago

I just found that the blt's mod manager forgets if you change automatic updates on or off if you update a mod and use the "restart game" button to apply changes. Due to this, no. I was not on the current version. Though before and after the update, both versions are labelled as v2.3.0. I assume this is you not changing the version number because of how small the update is. I personally would always change the number, no matter how small the change.

segabl commented 1 year ago

yeah version number did not change, I usually forget about that for small fixes

ghost commented 1 year ago

I guess we call it fixed for now again then?

segabl commented 1 year ago

I suppose so. Can always reopen if it somehow happens again