Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random memory corruption from new input patches that rely on SDL. #2

Open
DreamyCecil opened this issue Dec 15, 2024 · 0 comments
Open
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

Comments

@DreamyCecil
Copy link
Member

DreamyCecil commented Dec 15, 2024

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 being NULL, 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

  • This same bug might be the root cause of Rare random problems with creating game windows. GameExecutable#3 but I cannot determine whether that's true or not.
  • During the development of the new input system I kept getting assertions in CInputPatch::P_SetKeyNames() on strings that were supposed to be created to contain button names (see FIXME note in there). For some reason, instead of being set to "", some button names were set to NULL, resulting in the assertion. This might have something to do with the issue number 2, if not all of them.
@DreamyCecil DreamyCecil added bug Something isn't working help wanted Extra attention is needed unconfirmed Something that is hard to reproduce for debugging topic:input Related to input patches that also rely on SDL labels Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant