Skip to content

mlibc panics on OOM instead of passing it to program #1268

Open
@streaksu

Description

@streaksu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions