Help regarding the VM Execution BEEFCAFE pointer

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Help regarding the VM Execution BEEFCAFE pointer

Re: Help regarding the VM Execution BEEFCAFE pointer

by drfrag » Wed Aug 18, 2021 4:42 am

Thanks! I think it's fixed merging the GZDoom code. Seems i don't need to bump SAVEVER.
https://github.com/drfrag666/gzdoom/commits/legacy

Re: Help regarding the VM Execution BEEFCAFE pointer

by _mental_ » Wed Aug 18, 2021 1:18 am

drfrag wrote:So it wasn't a bug in the end but an user error?
No matter what users do, engine should not crash. Errors and even fatal errors are OK, crashes are not.
drfrag wrote:I could not reproduce the crash with their savegame since they used an old iwad.
Load attached .pk3 with the following command line, respawn, and hit the switch.

Code: Select all

-iwad doom2 -file player_corpse_queue.pk3 -host 1 +map map01
drfrag wrote:You really should try with GZDoom to see if something it's actually a LZDoom bug or if it's even a bug.
GZDoom works fine because corpse queue is no longer implemented using thinkers list. So, player corpse won't appear in more than one list simultaneously.
Attachments
player_corpse_queue.pk3
(1.45 KiB) Downloaded 165 times

Re: Help regarding the VM Execution BEEFCAFE pointer

by Graf Zahl » Tue Aug 17, 2021 11:27 am

If that was indeed the cause a fix may be to block player corpses from getting added to the corpse queue. AFAIK the engine does perform some stat list shenanigans with them which may interfere with corpse queue operation.

Re: Help regarding the VM Execution BEEFCAFE pointer

by drfrag » Tue Aug 17, 2021 11:11 am

So it wasn't a bug in the end but an user error? I could not reproduce the crash with their savegame since they used an old iwad.
You really should try with GZDoom to see if something it's actually a LZDoom bug or if it's even a bug.

Re: Help regarding the VM Execution BEEFCAFE pointer

by capnbunnypaws » Tue Aug 17, 2021 9:35 am

Graf Zahl wrote:That would be in the C++ source, not in script code.
As a first test, I'd suggest you remove the A_QueueCorpse call from NewDisciplePlayer and BaseDisciplePlayer. This function is meant for monster corpses and may cause some issues with dead players.
We have tried your solution, and it seems to have worked. The player I was using did not leave a corpse as before, and did not trigger an error thoughout our playthrough. So that seems to be solved, the error was that I copypasted the Disciple monster's code, without considering it as a player, leaving it to queue up a corpse as a monster.
However, there is still the issue of the skills suddenly ceasing functioning. I cannot provide anything to reproduce the error, but I could try describing the conditions, since this isn't a case of a crash, rather than something changing states bizzarely. The issue occurred consistently at the end of the Seven Portals, after pressing the three levers needed to open the exit. The skills I had on my player character were mainly CallCleric, CallFighter, CallMage. For the vast part of the game, they worked as intended: if nothing exists, summon; if it exists, ThingMove; if double clicked, remove. However, after passing said stage, the skills would either show a "Passive" text or a "Not Learned" text, without any idea why.
It isn't the original issue, but maybe you could enlighten us regarding a potential cause? We would be very grateful.

Re: Help regarding the VM Execution BEEFCAFE pointer

by _mental_ » Tue Aug 17, 2021 9:16 am

The bug isn't the same as the mentioned one in the modern codebase. However, it's still about double freeing of an object.
I suspect, the problem is in addition of a pointer to more than one thinker lists, STAT_PLAYER and STAT_CORPSEPOINTER.
This explains why changing a level is needed in order to reproduce the crash.

Re: Help regarding the VM Execution BEEFCAFE pointer

by drfrag » Tue Aug 17, 2021 5:04 am

Okay wrong working directory, about the different level is that becouse they were using hexen 1.0 instead of 1.1? I guess that's the case.
_mental_ wrote:id you do all the steps needed to trigger overflow of corpse queue during GC propagation?
I did and i already had checked that bug in the past.

Re: Help regarding the VM Execution BEEFCAFE pointer

by drfrag » Tue Aug 17, 2021 4:29 am

It's loaded from the command line but not from the debugger, seems the file is in use by VS itself but i get the error "savegame is from a different level".
From Vs the internal my_wstat64 function returns -1 since GetFileAttributesExW fails.

Re: Help regarding the VM Execution BEEFCAFE pointer

by capnbunnypaws » Tue Aug 17, 2021 4:10 am

drfrag wrote:I don't think it's the same crash, with your sample script it didn't crash and the implementation of the corpse queue is the old one.
But how do i reproduce the crash? Have you loaded the savegame? I cannot load it with the command line "-file woc_4.pk3 -loadgame ZdoomedBros1.zds" it says that it cannot find it.
I am not certain about the loadgame, but we have. The loadgame worked, we could move, do actions, kill all monsters/baddies with the console, but the moment we entered a portal, or used the changemap command, it instantly crashed with the aforementioned error. I have no idea why the loadgame does not work, I did add it all as it were in the folder. Perhaps it being a two player multiplayer has something to do with it?

We will currently be testing Graf Zahl's solution, which was removing the A_QueueCorpse from the player definitions. I will deliberately kill my player at the beginning of the hub and we will see if we can complete it without issues.

Re: Help regarding the VM Execution BEEFCAFE pointer

by _mental_ » Tue Aug 17, 2021 4:05 am

drfrag wrote:I don't think it's the same crash, with your sample script it didn't crash and the implementation of the corpse queue is the old one.
Did you do all the steps needed to trigger overflow of corpse queue during GC propagation? Even if so, this doesn't mean that the old implementation is bug-free.
It's based on garbage collected objects and a linked list (own stat thinkers), so the error could be pretty much anywhere.
drfrag wrote:But how do i reproduce the crash? Have you loaded the savegame?
I reconstructed the callstack from the provided crash dump. Debugging it with coop saved game is out of scope for me.

Re: Help regarding the VM Execution BEEFCAFE pointer

by Graf Zahl » Tue Aug 17, 2021 3:50 am

That would be in the C++ source, not in script code.
As a first test, I'd suggest you remove the A_QueueCorpse call from NewDisciplePlayer and BaseDisciplePlayer. This function is meant for monster corpses and may cause some issues with dead players.

Re: Help regarding the VM Execution BEEFCAFE pointer

by drfrag » Tue Aug 17, 2021 3:46 am

I don't think it's the same crash, with your sample script it didn't crash and the implementation of the corpse queue is the old one.
But how do i reproduce the crash? Have you loaded the savegame? I cannot load it with the command line "-file woc_4.pk3 -loadgame ZdoomedBros1.zds" it says that it cannot find it.

Re: Help regarding the VM Execution BEEFCAFE pointer

by capnbunnypaws » Tue Aug 17, 2021 3:36 am

_mental_ wrote:
Spoiler: Callstack of the crash
Presence of DCorpsePointer makes me think that it's the same corpse queue crash, just for the old codebase. Most likely, a WriteBarrier is missing somewhere.
Sorry for the silly question, but where do I find the exact line on LZDoom 3.88a? I understood the fix in question, but fail to find the location while browsing the lzdoom.pk3. Unless I am looking in the wrong location?

Re: Help regarding the VM Execution BEEFCAFE pointer

by _mental_ » Tue Aug 17, 2021 1:55 am

Spoiler: Callstack of the crash
Presence of DCorpsePointer makes me think that it's the same corpse queue crash, just for the old codebase. Most likely, a WriteBarrier is missing somewhere.

Re: Help regarding the VM Execution BEEFCAFE pointer

by capnbunnypaws » Mon Aug 16, 2021 3:42 am


Top