Skip to content

fix segfault caused by memory allocated in one pool and freed in another#533

Open
jp-embedded wants to merge 1 commit intogittup:masterfrom
jp-embedded:pool_allocation
Open

fix segfault caused by memory allocated in one pool and freed in another#533
jp-embedded wants to merge 1 commit intogittup:masterfrom
jp-embedded:pool_allocation

Conversation

@jp-embedded
Copy link
Copy Markdown

On large projects tup ends up in a segfault because mem_pool::next_alloc_size wraps around to 0 so it allocates a new block of 0 bytes instead of 4GB. next_alloc_size should be of type size_t to match the pointer size to avoid this.

However it turns out that the underlying issue is that all file_entry entries are allocated in the fuse server thread but put back on the free-list in the worker threads where they cannot be reused by the fuse server thread. The result is that the fuse server thread keeps allocating new entries and the worker threads free-list keeps growing.

This PR fixes both.

This fixes #532

@jp-embedded jp-embedded changed the title fix memory allocated in one pool and freed in another fix segfault caused by memory allocated in one pool and freed in another Apr 21, 2026
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.

tup segfaults on big projects

1 participant