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

Ensure that temporary process exits normally #263

Merged
merged 1 commit into from
May 22, 2023

Conversation

nsavoire
Copy link
Collaborator

Killing the temporary intermediate process generates false memory leak reports in valgrind because some resources are not cleaned up (eg. local strings on the stack).
The fix is to install a sigterm handler in temp pid, and upon receiving SIGTERM, make temp pid exits normally through main.

@nsavoire nsavoire force-pushed the nsavoire/ensure_cleanup_in_temp_pid branch from 5c1d940 to 058db25 Compare May 17, 2023 13:26
@r1viollet
Copy link
Collaborator

CI seems to be KO :-), This seems like a cleaner approach!

Killing the temporary intermediate process generates false
memory leak reports in valgrind because some resources are
not cleaned up (eg. local strings on the stack).
The fix is to install a sigterm handler in temp pid, and
upon receiving SIGTERM, make temp pid exits normally through
main.
@nsavoire nsavoire force-pushed the nsavoire/ensure_cleanup_in_temp_pid branch from 058db25 to b39fe36 Compare May 17, 2023 20:46
@nsavoire
Copy link
Collaborator Author

CI seems to be KO :-), This seems like a cleaner approach!

No idea what was going on with CI. Seems OK after rebase.


struct sigaction sa;
if (sigemptyset(&sa.sa_mask) == -1) {
exit(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: we should define a library logger for these cases.

Copy link
Collaborator

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM!
Good thinking, this will make leak analysis easier.

@nsavoire nsavoire merged commit 6aa13d9 into main May 22, 2023
@nsavoire nsavoire deleted the nsavoire/ensure_cleanup_in_temp_pid branch May 22, 2023 07:23
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