panic: "failed to allocate critical IO buffer"
- expected result: No panics
- actual result: Panics
- sled version: 0.34.7
- rustc version:
rustc 1.94.1 (e408947bf 2026-03-25) - operating system: Alpine (in a custom container)
- minimal code sample that helps to reproduce the issue: don't have one at this moment, sorry.
- logs, panic messages, stack traces:
thread 'log flusher' (17922) panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sled-0.34.7/src/pagecache/iobuf.rs:43:9:
failed to allocate critical IO bufferNOTE: It seems that iobuf.rs is gone in the current main branch, but I figure I should report this anyway in case it is still relevant.
While running a program using sled for mapping keys to offsets (should be less than 100 bytes for key+value per entry) I suddenly encountered:
thread 'log flusher' (17922) panicked at /root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/sled-0.34.7/src/pagecache/iobuf.rs:43:9:
failed to allocate critical IO bufferThe code in question: https://github.com/spacejam/sled/blob/d81865d07f07910133877915b57abf0c52d5756b/src/pagecache/iobuf.rs#L38-L47
If I had to guess it tried to alllocate an excessively large amount of memory and alloc simply refused, returning null.
I have been using sled for a while in my program without issues, so I'm unsure if I can reproduce this issue soon. If I manage to reproduce it consistently I'll update this issue.
FWIW the db file is currently at 11GB and my computer has 128GB RAM (no on-disk swap but does have 1G of zram).
Source: spacejam/sled