Skip to content

Handle memory exceptions errors in MEMFS #17232

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

Closed
wants to merge 1 commit into from
Closed

Handle memory exceptions errors in MEMFS #17232

wants to merge 1 commit into from

Conversation

goldwaving
Copy link
Contributor

When memory allocation exceptions occur in MEMFS from a thread, it causes the thread to fail without recovery (see #16548 and #11496 for details). Instead we catch the exception at the source and replace it with an ERRNO exception, which is handled appropriately. This also works better for non-threaded code. Other exception values to consider: EDQUOT or ENOSPC.

When memory allocation exceptions occur in MEMFS from a thread, it causes the thread to fail without recovery (see #16548 and #11496 for details).  Instead we catch the exception at the source and replace it with an ERRNO exception, which is handled appropriately.  This also works better for non-threaded code.  Other exception values to consider: EDQUOT or ENOSPC.
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the formatting fixed.

Comment on lines +122 to +123
}
catch(e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
catch(e) {
} catch(e) {

This pull request was closed.
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.

3 participants