Possible allocator issues
While building GCC in Astral, mlibc accesses invalid memory while allocating memory for the application. The fault happens in frigg's rbtree implementation.
From what I have managed to gather, this is what happens:
- Some memory still being used by the allocator's rbtree is unmapped here.
- When the application calls malloc, the rbtree function faults, as it tries to access that unmapped range.
Frigg has allocation tracing capabilities, it would be useful for debugging if such a trace could be acquired for this issue. Without this I suspect this will be exceedingly difficult to debug, especially because the Frigg allocator is quite well tested.
Still don't have a trace. However, enabling FRG_SLAB_TRACK_REGIONS causes the following assertion to fail:
/sysroot/usr/share/mlibc-build/frigg/include/frg/rbtree.hpp:213: Assertion 'grand && h(grand)->color == color_type::black' failed!
This is due to h(grand)->color being color_type::red
Was an issue with my virtual memory manager that only happened under very specific circumstances.