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

Fix for endless loop bug in Z_Malloc and flood-protect fix for amtele/amtelemark #146

Closed
wants to merge 2 commits into from

Conversation

TomArrow
Copy link

Consists of 2 things.

  1. RE_RegisterImages_LevelLoadEnd always returns qtrue atm, due to a variable being wrongly initialized, causing endless loops when called from Z_Alloc. Z_Alloc wants to find ways to free memory... asks RE_RegisterImages_LevelLoadEnd to do so. RE_RegisterImages_LevelLoadEnd reports back that an image was deleted (qtrue) even if no image was deleted. Z_Alloc then thinks ok, let's retry the malloc... endless loop, for hours even, forcing you to quit the process instead of gracefully erroring and disconnecting. You can compare this to the behavior of the original released jka code, it's only supposed to return qtrue if an image was actually deleted, else Z_Alloc can never fall through to the lower down conditions to either delete other stuff like models/sounds or actually gracefully quit. The error was introduced in this commit:
    d405b33

  2. Currently amtele/amtelemark is always not ratelimited if sv_newFloodProtect is >1. This may not be desired as in some circumstances people could abuse it to spam teleport sounds/effects. Proposed solution here is to only disable ratelimiting for amtele/amtelemark if sv_newFloodProtect is >2, and otherwise fall back to the old behavior. This allows the old behavior to be restored before the amtele exception was formerly introduced in this commit:
    ef4648a

@taysta
Copy link
Owner

taysta commented Feb 15, 2024

I'll take the first issue raised upstream from JACoders#1209, and had already suggested the same fix with for the second issue you raised, in loda said he is going to do it differently. I'll be closing this PR.

@taysta taysta closed this Feb 15, 2024
taysta added a commit that referenced this pull request Feb 17, 2024
@taysta
Copy link
Owner

taysta commented Feb 17, 2024

Hi Tom,
I have introduced the fix for the Z_Malloc endless loop here: #150
I also had to apply it to the Vulkan renderer. Thanks for reporting this problem. Loda said he is still deciding on his floodprotect implementation. Will keep you updated.

taysta added a commit that referenced this pull request Feb 17, 2024
* [rend2] Fix overly bright ibl cloth specular

* [rend2] Reduce goreVBO size

* [OpenJK/Vulkan] Fix endless loop in Z_Malloc due to imageDeleted always being qtrue (from JACoders#1209 and #146)

---------

Co-authored-by: SomaZ <17459161+SomaZ@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants