Skip to content

Conversation

@Architector4
Copy link
Contributor

@Architector4 Architector4 commented Jan 25, 2026

Allocation pooling obscures whether or not memory is freed or not from AddressSanitizer, making it less useful.

With this patch, the game works same as it ever was, but AddressSanitizer now properly finds some errors that previously would only trigger spurious really cryptic UndefinedBehaviorSanitizer errors.

I suspect these cryptic errors have the exact same root causes as what causes random memory corruption crashes the development branch has. Being able to use ASan to find them is an important step in fixing these, I think.

An alternative would be to, instead of doing this, use ASan's API to poison/unpoison memory. However, the functions to do that require an allocation size to be provided, and the memory pooling functions don't get those.

An alternative to the address sanitizer detection concoction that this patch has would be to check for DEBUGMODE instead, but I figured it's better to leave pooling enabled for that in case someone is building with debug mode specifically to debug that lol

Allocation pooling obscures whether or not memory is freed or not from
AddressSanitizer, making it less useful.

With this patch, the game works same as it ever was, but
AddressSanitizer now properly finds some errors that previously would
only trigger spurious really cryptic UndefinedBehaviorSanitizer errors.

An alternative would be to, instead of doing this, use ASan's API to
poison/unpoison memory. However, the functions to do that require an
allocation size to be provided, and the memory pooling functions don't
get those.
@Causeless Causeless added this pull request to the merge queue Jan 25, 2026
Merged via the queue into cortex-command-community:development with commit 87f1a49 Jan 25, 2026
4 checks passed
@Architector4 Architector4 deleted the patch-no-allocation-pool-for-asan branch January 25, 2026 21:51
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