Closed MarinPostma closed 4 months ago
@MarinPostma, JFYI, it seems like current implementation of allocator can cause SEGFAULT (see https://github.com/tursodatabase/libsql/pull/1486#discussion_r1647736447)
Should we fix it?
Yes! Do you have a reproducer? I kinda found weird stuff this weekend but didn't have the time to investigate, so I thought I'd just disable it for now
I just read the comment, I'll fix it now, but not as bad as I thought. It's almost impossible to get a system allocator return null
No, I just read the code for now - don't have any example with real SEGFAULT.
I just thought that fix is easy (we just need to correctly handle nullptr output from the allocator) - and it's good to do that now given that it's unclear when mimalloc
will be enabled again in libsql
(and by this time all of us will forget about nuances of implementation).
But if you are busy you can merge this PR and I will create fix for mimalloc
bit later.
done
since fragmentation is not the cause of the leak, put the sqlite mimalloc allocator behind a flag for now