-
Notifications
You must be signed in to change notification settings - Fork 618
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
Check if reentrant version of CFITSIO is used #5239
Conversation
533a412
to
d26b271
Compare
CI MESSAGE: [11485028]: BUILD STARTED |
CI MESSAGE: [11485028]: BUILD PASSED |
|
||
DALI_ENFORCE(fits_is_reentrant(), | ||
"Loaded instance of cfitsio library does not support multithreading. " | ||
"Please recompile cfitsio in reentrant mode (--enable-reentrant) " | ||
"or use cfitsio delivered in DALI_deps"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just warn the user and guard the code with a mutex, like this?
std::unique_lock lock(mtx, std::defer_lock);
if (!fits_is_reentrant)
lock.lock();
...unless we statically link it and ship it with the .whl.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added locking to FITS_CALL
DALI_DEPS_VERSION
Outdated
@@ -1 +1 @@ | |||
345c534814ffcfd40c2df3fe3d4a00c0d911b94c | |||
FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert to what's in main - the relevant DALI_deps PR has already been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
9b9e70a
to
57af13a
Compare
!build |
CI MESSAGE: [11957948]: BUILD STARTED |
CI MESSAGE: [11957948]: BUILD PASSED |
Check if reentrant version of CFITSIO is used. If not, emit a warning and use exclusive lock when calling CFITSIO functions. --------- Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
Check if reentrant version of CFITSIO is used. If not, emit a warning and use exclusive lock when calling CFITSIO functions. --------- Signed-off-by: Szymon Karpiński <skarpinski@nvidia.com>
Category:
Bug fix (non-breaking change which fixes an issue)
Description:
CFITSIO is by default compiled in non-reentrant mode, resulting in segfaults when two or more pipelines are active. NVIDIA/DALI_deps#96 enables multithreading and this PR adds a runtime check and a test for that.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-3746