-
Notifications
You must be signed in to change notification settings - Fork 639
Fix stdin handling in CUFileDriverScope #5902
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
Conversation
a8b66cc
to
76b925e
Compare
!build |
CI MESSAGE: [27700108]: BUILD STARTED |
CI MESSAGE: [27700108]: BUILD FAILED |
76b925e
to
e77deac
Compare
!build |
CI MESSAGE: [27704106]: BUILD STARTED |
CI MESSAGE: [27704106]: BUILD FAILED |
- adds stdin backup and restore mechanism to prevent issues with file descriptor handling when using cuFile library. This fixes a problem where cuFileDriverOpen could close stdin, causing subsequent GDS file operations to fail when the file descriptor 0 is reused. Signed-off-by: Janusz Lisiecki <[email protected]>
e77deac
to
1518bfb
Compare
!build |
CI MESSAGE: [27711278]: BUILD STARTED |
@@ -32,7 +33,23 @@ namespace test { | |||
|
|||
struct CUFileDriverScope { | |||
CUFileDriverScope() { | |||
// cuFileDriverOpen is some versions of cuFile library, can close stdin |
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.
// cuFileDriverOpen is some versions of cuFile library, can close stdin | |
// cuFileDriverOpen in some versions of cuFile library, can close stdin |
@@ -43,10 +60,42 @@ struct CUFileDriverScope { | |||
#pragma push_macro("cuFileDriverClose") | |||
#undef cuFileDriverClose | |||
if (cuFileIsSymbolAvailable("cuFileDriverClose_v2")) { | |||
// cuFileDriverOpen is some versions of cuFile library, can close stdin |
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.
// cuFileDriverOpen is some versions of cuFile library, can close stdin | |
// cuFileDriverOpen in some versions of cuFile library, can close stdin |
} else { | ||
// cuFileDriverOpen is some versions of cuFile library, can close stdin |
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.
// cuFileDriverOpen is some versions of cuFile library, can close stdin | |
// cuFileDriverOpen in some versions of cuFile library, can close stdin |
dali/util/cufile_helper.h
Outdated
@@ -37,15 +38,47 @@ struct CUFileDriverScope { | |||
CUFileDriverScope() { | |||
// v2 API performs proper reference counting, so we increase the reference count here... | |||
if (cuFileIsSymbolAvailable("cuFileDriverClose_v2")) { | |||
// cuFileDriverOpen is some versions of cuFile library, can close stdin |
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.
// cuFileDriverOpen is some versions of cuFile library, can close stdin | |
// cuFileDriverOpen in some versions of cuFile library, can close stdin |
dali/util/cufile_helper.h
Outdated
} | ||
} | ||
~CUFileDriverScope() { | ||
// ...and decrease it here. | ||
// The old GDS API would simply destroy the library, possibly still in use by other modules | ||
// within the process. | ||
if (cuFileIsSymbolAvailable("cuFileDriverClose_v2")) { | ||
// cuFileDriverOpen is some versions of cuFile library, can close stdin |
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.
// cuFileDriverOpen is some versions of cuFile library, can close stdin | |
// cuFileDriverOpen in some versions of cuFile library, can close stdin |
CI MESSAGE: [27711278]: BUILD FAILED |
CI MESSAGE: [27711278]: BUILD PASSED |
Signed-off-by: Janusz Lisiecki <[email protected]>
!build |
CI MESSAGE: [27749210]: BUILD STARTED |
CI MESSAGE: [27749210]: BUILD PASSED |
handling when using cuFile library. This fixes a problem where cuFileDriverOpen/Close
could close stdin, causing subsequent GDS file operations to fail when the file
descriptor 0 is reused.
Category:
Bug fix (non-breaking change which fixes an issue)
Description:
handling when using cuFile library. This fixes a problem where cuFileDriverOpen/Close
could close stdin, causing subsequent GDS file operations to fail when the file
descriptor 0 is reused.
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: N/A