mlibc icon indicating copy to clipboard operation
mlibc copied to clipboard

mlibc panics on OOM instead of passing it to program

Open streaksu opened this issue 10 months ago • 4 comments

When running on Gloire (even though this should be reproducible in other systems), compiling and running code like

#include <stdlib.h>

int main(void) {
    void *example = malloc(0xFFFFFFFFFF);
}

results in mlibc panicking if the mmap sysdep fails, which can happen in out of memory conditions.

The expected behavior is for mlibc to pass the error to userland for handling by the application.

I will attach an image of the error and test program as tested in Gloire.

Image

streaksu avatar Feb 23 '25 14:02 streaksu