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

Provide way to catch OOM in C API #2396

Open
seanmonstar opened this issue Jan 12, 2021 · 1 comment
Open

Provide way to catch OOM in C API #2396

seanmonstar opened this issue Jan 12, 2021 · 1 comment
Labels
A-ffi Area: ffi (C API) B-upstream Blocked: needs a change in a dependency or the compiler.

Comments

@seanmonstar
Copy link
Member

Currently, allocation errors automatically result in an abort, which is undesirable in the C API. We could look into using std::alloc::set_alloc_error_hook or similar, to override the default behavior so that it doesn't abort, but does some sort of panic!(HyperOom), and we catch that at the FFI boundary (like all panics). However, that is not a stable function. First step is likely to get libstd to stabilize something we can use.

Originally from #2265 (comment)

@seanmonstar seanmonstar added A-ffi Area: ffi (C API) B-upstream Blocked: needs a change in a dependency or the compiler. labels Jan 12, 2021
@seanmonstar
Copy link
Member Author

As a check-in (at least for myself), there's the following tracking issues for the lang/libstd:

The status of those issues don't seem to have changed. It may need more active attention from us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ffi Area: ffi (C API) B-upstream Blocked: needs a change in a dependency or the compiler.
Projects
None yet
Development

No branches or pull requests

1 participant