Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LibOS] RLIMIT_STACK is reset to default value in child process #1974

Open
dimakuv opened this issue Aug 19, 2024 · 0 comments · May be fixed by #1976
Open

[LibOS] RLIMIT_STACK is reset to default value in child process #1974

dimakuv opened this issue Aug 19, 2024 · 0 comments · May be fixed by #1976

Comments

@dimakuv
Copy link
Contributor

dimakuv commented Aug 19, 2024

Description of the problem

Seems like RLIMIT_STACK is overwritten to the default value (read from the manifest file) in the child process.

In other words, a program like this:

    struct rlimit rlim = { .rlim_cur = 1024*1024, .rlim_max = 1024*1024*1024 };
    setrlimit(RLIMIT_STACK, rlim);
    fork();
    ... child runs ...

will not inherit the set-by-parent stack limit. Instead the child will use the stack size read from the manifest file.

This is in contrast to how other resource limits are propagated to the child, in particular, the brk (RLIMIT_DATA) limit:

/* TODO: this needs a better fix. Currently after fork, in the new child process, `libos_init`
* is run, hence this function too - but forked process will get its brk from checkpoints. */
if (brk_region.brk_start) {
return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant