Random memory corruption from new input patches that rely on SDL. #2
Labels
bug
Something isn't working
help wanted
Extra attention is needed
topic:input
Related to input patches that also rely on SDL
unconfirmed
Something that is hard to reproduce for debugging
Sometimes, when starting a game with the patch, there's a chance to get into one of the "corrupted" states, where new input code may behave in buggy ways.
This bug began occurring since 1.9-pre1.
Types of issues
Different states that the specific game instance can fall into. This state always persists in the game instance instead of firing at random times. The only way to fix it is restart the game and hope that it doesn't end up in any other corrupted state, which is relatively rare.
1. Crash on game start
When starting a new game from the menu, the game crashes after loading the world and creating the player. Checking the debugger reveals a place in the new input code that tries to get a value from a shell symbol (one of them in the beginning of
CInputPatch::P_GetInput()
) but it ends up beingNULL
, causing a memory access violation exception.It is definitely not the issue with the symbol because this symbol is supposed to be registered by the engine and everything works fine most other times when there's no crash. Something is corrupting that specific symbol's memory.
2. Button controls being reset
After using "select axis automatically from any movement" feature in "Advanced Joystick Setup" menu at least once, the current game instance enters this weird state where specific button binds in "Customize Buttons" menu are now being nullified and always set to "None". This isn't happening randomly but rather every single time in that specific game instance.
These buttons aren't being reset at random. For example, some of the buttons that always get reset are "Move Right" (or specifically "Arrow Right" when bound to anything), "Use" (or specifically "Enter" when bound to anything) and weapon selection on "5".
Though unconfirmed, this second bug might be happening under other circumstances as well (or completely at random). This joystick feature is the only thing that was found to consistently produce this bug.
Related issues
CInputPatch::P_SetKeyNames()
on strings that were supposed to be created to contain button names (seeFIXME
note in there). For some reason, instead of being set to""
, some button names were set toNULL
, resulting in the assertion. This might have something to do with the issue number 2, if not all of them.The text was updated successfully, but these errors were encountered: