-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix Linux 32-bits encoded timestamp limitation - 2038K Bug #35
base: omr1
Are you sure you want to change the base?
Conversation
This need to be fixed on all the branches and the original project too. Let's do the patch review on this particular branch of interest for me. Once this is merged, I will port to the other branches and also the https://github.com/Intel-Media-SDK/MediaSDK project and submit the pull requests. |
a850da5
to
b6daa26
Compare
Thank you for approving this pull request. I got a similar patch merged into the Intel MediaSDK project Intel-Media-SDK/MediaSDK@f3f9e03. |
This issue is on all version of MediaSDK. Which branches do you need a pull request for ? |
Hi Jeremy, BTW, please add 'Tracked-On: OAM-92928' at the end of your commit message, so that I can merge it. |
Historically time_t has been encoded on Linux as 32-bits signed integer and with Linux 32 bits <5.6 it is still encoded as a 32-bits signed integer. As a consequence beyond January 2038 gettimeofday() will start returning a negative timestamp and this negative timestamp will be supplied to pthread_cond_timedwait() by MediaSDK. The Linux kernel will detects the invalid timestamp and return -EINVAL making MediaSDK unusable. This patch makes use of the 'clock_gettime(CLOCK_MONOTONIC, ...)' to get current time since boot and configure the condition variable to use the same clock. Since this patch only impact the timestamped used for the pthread_cond_timedwait() calls it has no impact in the other components. Tracked-On: OAM-92928 Signed-off-by: Jeremy Compostella <[email protected]>
b6daa26
to
fa22e10
Compare
|
Historically time_t has been encoded on Linux as 32-bits signed
integer and with Linux 32 bits <5.6 it is still encoded as a 32-bits
signed integer. As a consequence beyond January 2038 gettimeofday()
will start returning a negative timestamp and this negative timestamp
will be supplied to pthread_cond_timedwait() by MediaSDK. The Linux
kernel will detects the invalid timestamp and return -EINVAL making
MediaSDK unusable.
This patch makes use of the 'clock_gettime(CLOCK_MONOTONIC, ...)' to
get current time since boot and configure the condition variable to
use the same clock.
Since this patch only impact the timestamped used for the
pthread_cond_timedwait() calls it has no impact in the other
components.
Signed-off-by: Jeremy Compostella [email protected]