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

repair for system in thread that can be deactivated #759

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

mflatt
Copy link
Contributor

@mflatt mflatt commented Nov 19, 2023

The system primitive is intended to be like a __collect_safe foreign call, allowing other threads to perform a collection while waiting for the shell command to return. Its shell-command argument is allocated, however, so system needs a copy of its argument while its thread is deactivated.

Copy link
Contributor

@jltaylor-us jltaylor-us left a comment

Choose a reason for hiding this comment

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

I suppose this probably should check that malloc was able to allocate memory... presumably with error handling similar to that is S_malloc but with a different error message.

The `system` primitive is intended to be like a `__collect_safe`
foreign call, allowing other threads to perform a collection while
waiting for the shell command to return. Its shell-command argument is
allocated, however, so `system` needs a copy of its argument while
its thread is deactivated.
@mflatt
Copy link
Contributor Author

mflatt commented Nov 20, 2023

Thanks — malloc check added.

@mflatt mflatt merged commit d7cc2cf into cisco:main Nov 21, 2023
13 checks passed
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.

2 participants