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

BUG: fix potential segfault with apps that fork() and use Darshan app exclusions #922

Merged
merged 2 commits into from
Apr 14, 2023

Conversation

shanedsnyder
Copy link
Contributor

The Darshan library is currently setting fork handlers near the beginning of its initialization routine -- notably, before we detect whether the app should be excluded from Darshan instrumentation (via new APP_EXCLUDE setting). These fork handlers expect Darshan library state to be initialized properly, but that clearly does not happen if the app is excluded (there is no Darshan library state in this case). This is currently leading to crashes for this scenario (excluded app that calls fork).

To fix, don't set Darshan fork handlers until it's known that library initialization succeeded.

Darshan fork handlers expect Darshan library state to be set, but
this doesn't happen when an app is excluded from instrumentation.
To fix, don't set Darshan fork handlers until it's known that
library initialization succeeded.
don't do anything if darshan_core is NULL
Copy link
Contributor

@carns carns left a comment

Choose a reason for hiding this comment

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

good catch; this looks great

@shanedsnyder shanedsnyder merged commit 59970a5 into main Apr 14, 2023
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