Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 870759 Details for
Bug 1072700
_spice_timer_set truncates large "now" values
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Tentative fix
1000-time-overflow-fixes.patch (text/plain), 1.92 KB, created by
David Gibson
on 2014-03-05 04:30:22 UTC
(
hide
)
Description:
Tentative fix
Filename:
MIME Type:
Creator:
David Gibson
Created:
2014-03-05 04:30:22 UTC
Size:
1.92 KB
patch
obsolete
>diff -ur spice-0.12.4.orig/server/spice_timer_queue.c spice-0.12.4/server/spice_timer_queue.c >--- spice-0.12.4.orig/server/spice_timer_queue.c 2013-07-18 00:00:56.000000000 +1000 >+++ spice-0.12.4/server/spice_timer_queue.c 2014-03-05 15:02:24.568028188 +1100 >@@ -147,7 +147,7 @@ > return timer; > } > >-static void _spice_timer_set(SpiceTimer *timer, uint32_t ms, uint32_t now) >+static void _spice_timer_set(SpiceTimer *timer, uint32_t ms, uint64_t now) > { > RingItem *next_item; > SpiceTimerQueue *queue; >@@ -183,7 +183,8 @@ > spice_assert(pthread_equal(timer->queue->thread, pthread_self()) != 0); > > clock_gettime(CLOCK_MONOTONIC, &now); >- _spice_timer_set(timer, ms, now.tv_sec * 1000 + (now.tv_nsec / 1000 / 1000)); >+ _spice_timer_set(timer, ms, >+ (uint64_t)now.tv_sec * 1000 + (now.tv_nsec / 1000 / 1000)); > } > > void spice_timer_cancel(SpiceTimer *timer) >@@ -217,7 +218,7 @@ > unsigned int spice_timer_queue_get_timeout_ms(void) > { > struct timespec now; >- int now_ms; >+ int64_t now_ms; > RingItem *head; > SpiceTimer *head_timer; > SpiceTimerQueue *queue = spice_timer_queue_find_with_lock(); >@@ -232,9 +233,9 @@ > head_timer = SPICE_CONTAINEROF(head, SpiceTimer, active_link); > > clock_gettime(CLOCK_MONOTONIC, &now); >- now_ms = (now.tv_sec * 1000) - (now.tv_nsec / 1000 / 1000); >+ now_ms = ((int64_t)now.tv_sec * 1000) - (now.tv_nsec / 1000 / 1000); > >- return MAX(0, ((int)head_timer->expiry_time - now_ms)); >+ return MAX(0, ((int64_t)head_timer->expiry_time - now_ms)); > } > > >@@ -252,7 +253,7 @@ > } > > clock_gettime(CLOCK_MONOTONIC, &now); >- now_ms = (now.tv_sec * 1000) + (now.tv_nsec / 1000 / 1000); >+ now_ms = ((uint64_t)now.tv_sec * 1000) + (now.tv_nsec / 1000 / 1000); > > while ((head = ring_get_head(&queue->active_timers))) { > SpiceTimer *timer = SPICE_CONTAINEROF(head, SpiceTimer, active_link); >Only in spice-0.12.4/server: spice_timer_queue.c~
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1072700
: 870759