Fix immediate Window Maker crashes due to new memory management patterns #2

Merged
trurl merged 8 commits from trurl/wmaker:refactor/wutil-rs-fix-memory-fn-calls into refactor/wutil-rs 2025-10-25 12:51:24 -04:00
Owner

Window Maker now crashes right after launching. This PR addresses some of the most immediate causes:

  • Writing our own wmalloc/wfree/wrealloc that actually do something different from the system malloc/free/realloc means that this codebase can no longer do things like pass pointers from wmalloc to free.
  • Our hashtable rewrite was pulled in from a stale branch without adequate integration testing. It turns out that the WUtils hashtable should not take ownership of keys and values. We can't be rid of WMHashTable fast enough, but correcting this ownership story should suffice for now.
Window Maker now crashes right after launching. This PR addresses some of the most immediate causes: * Writing our own `wmalloc`/`wfree`/`wrealloc` that actually do something different from the system `malloc`/`free`/`realloc` means that this codebase can no longer do things like pass pointers from `wmalloc` to `free`. * Our hashtable rewrite was pulled in from a stale branch without adequate integration testing. It turns out that the WUtils hashtable should not take ownership of keys and values. We can't be rid of `WMHashTable` fast enough, but correcting this ownership story should suffice for now.
trurl added 8 commits 2025-10-25 12:50:30 -04:00
Replace `wmalloc` et al with wrappers around the Rust allocation
library.
Lessons learned: don't rebase so freely, review commits properly.
The WMHashTable rewrite was prematurely merged into refactor/wutil-rs, so we're
picking up the pieces now.
This fixes a lot of memory bugs which arose as a result of doing something
different from the system malloc/free when allocators were rewritten in Rust.

These changes originate from a different approach to writing the allocator in
Rust:
https://git.sdf.org/vitrine/wmaker/pulls/1/files#diff-04a0fd2319b9969373b75377716e45c836d22869

There are other function calls (to XFree) that need to be fixed, but that can be
done in another commit. This one is already getting large.
This fixes some crashes found in cursory smoke tests. You can now open and close
some windows without crashing immediately.
trurl merged commit 026426e6c3 into refactor/wutil-rs 2025-10-25 12:51:24 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitrine/wmaker#2