microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
10.28k stars 836 forks source link

Segfault on Google Chrome #754

Open Martmists-GH opened 1 year ago

Martmists-GH commented 1 year ago

OS: Arch Linux

output of MIMALLOC_VERBOSE=1 LD_PRELOAD=/usr/lib/libmimalloc.so google-chrome-stable 2> verbose.log

[1]    18329 segmentation fault (core dumped)  MIMALLOC_VERBOSE=1 LD_PRELOAD=/usr/lib/libmimalloc.so google-chrome-stable 2>

Verbose output: verbose.log

surfaceflinger commented 9 months ago

What could be done here? Could mimalloc somehow handle the fact that some projects have their own malloc impls? eg. chromium uses PartitionAlloc and as far as I remember, hardened_malloc from GrapheneOS project works fine LD_PRELOAD'd with Chromium/Electron/Google Chrome.

@thestinger don't want to bother, but does hardened_malloc have some compatibility workarounds or is it simply compatible with what Chromium expects?

thestinger commented 9 months ago

We don't have any compatibility workarounds at the moment. We have occasionally had to work around camera HAL memory corruption bugs on certain Pixel phones. Chromium works fine with hardened_malloc but it doesn't use malloc very much so it doesn't actually provide much hardening for it.

We recently added hardware memory tagging in hardened_malloc which is enabled by default on GrapheneOS. However, we need to also get it working via Chromium's support for it since having it only in hardened_malloc would accomplish very little for Chromium.