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 mi_cfree function missing certain big allocations #915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kerambyte
Copy link

The way mi_is_in_heap_region is implemented right now (see this code) it is possible to 'miss' certain huge allocations going through mi_cfree. So we either need to update the segment detection code (so that it is not limited to e.g. 2GiB on 32-bit platforms) or use the more expensive mi_check_owned check if we've failed the simpler heap check.

The way `mi_is_in_heap_region` is implemented right now (see [this](https://github.com/microsoft/mimalloc/blob/master/src/free.c#L112) code) it is possible to 'miss' certain huge allocations going through `mi_cfree`. So we either need to update the segment detection code (so that it is not limited to [e.g. 2GiB on 32-bit platforms](https://github.com/microsoft/mimalloc/blob/master/src/segment-map.c#L24)) or use the more expensive `mi_check_owned` check if we've failed the simpler heap check.
@kerambyte
Copy link
Author

Ah, looks like the 32-bit 'address-too-high' issue has been fixed somewhat recently - a964322

So perhaps this issue is no more. We've seen cases where on 32-bit platforms with really big allocations sometimes we'd get a segment address bigger than 2GiB and then that segment couldn't be 'found'.

I'll leave it to you to decide whether that commit fixes the issue or not, feel free to close this PR if it does. 👍

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.

1 participant