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

allocate_fd(): fail gracefully if descriptor cannot be allocated #1199

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

francescolavra
Copy link
Member

File descriptor allocation is triggered by userspace, thus if the allocation fails it should fail gracefully instead of triggering an assertion failure.
This commit fixes the "assertion buffer_set_capacity(b, new_len) == new_len failed in src/runtime/buffer.h: buffer_extend() on line 90; halt" error that happens if the application tries to open more files than the system can handle.
vector_set(), extend_total() and buffer_extend() have been modified in order to return a boolean value indicating whether the operation was successful.

File descriptor allocation is triggered by userspace, thus if the
allocation fails it should fail gracefully instead of triggering an
assertion failure.
This commit fixes the "assertion buffer_set_capacity(b, new_len) ==
new_len failed in src/runtime/buffer.h: buffer_extend() on line 90;
halt" error that happens if the application tries to open more
files than the system can handle.
vector_set(), extend_total() and buffer_extend() have been modified
in order to return a boolean value indicating whether the operation
was successful.
@francescolavra francescolavra merged commit c1d218a into master Jun 15, 2020
@francescolavra francescolavra deleted the fix/allocate_fd branch June 15, 2020 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants