Skip to contentSkip to conversation

Fix semaphores fallback code

PATCH Applied Brad Smith 2 participants 4 messages Dec 28, 2012 – Dec 29, 2012

lore
Share & tools
lore

Brad Smith

author
#0 lore raw

PATCH 1/1 Fix semaphores fallback code

As reported in bug 1087114 the semaphores fallback code is broken which results in QEMU crashing and making QEMU unusable.

This patch is from Paolo.

This needs to be back ported to the 1.3 stable tree as well.

util/qemu-thread-posix.c +1 -0
index 7be292e..17f2d7c 100644
@@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
     while (sem->count < 0) {
         rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts);
         if (rc == ETIMEDOUT) {
+            ++sem->count;
             break;
         }
         if (rc != 0) {
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#1 lore raw
Quoted 6 lines · Brad Smith

As reported in bug 1087114 the semaphores fallback code is broken which results in QEMU crashing and making QEMU unusable.

This patch is from Paolo.

This needs to be back ported to the 1.3 stable tree as well.

Needs to be back ported to HEAD as well because of the reorganization, or applied after Paolo's series.

Quoted 24 lines
util/qemu-thread-posix.c +1 -1
index 7be292e..17f2d7c 100644
@@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
     while (sem->count < 0) {
         rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts);
         if (rc == ETIMEDOUT) {
+            ++sem->count;
             break;
         }
         if (rc != 0) {
 
--

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

author
#2 lore raw
Quoted 4 lines · Blue Swirl
Quoted 3 lines · Brad Smith

As reported in bug 1087114 the semaphores fallback code is broken which results in QEMU crashing and making QEMU unusable.

Quoted 10 lines
Quoted 3 lines

This patch is from Paolo.

This needs to be back ported to the 1.3 stable tree as well.

Needs to be back ported to HEAD as well because of the reorganization, or applied after Paolo's series.

Quoted 3 lines

Here is a patch applied to HEAD.

qemu-thread-posix.c +1 -0
index 6374df3..4489abf 100644
@@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
     while (sem->count < 0) {
         rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts);
         if (rc == ETIMEDOUT) {
+            ++sem->count;
             break;
         }
         if (rc != 0) {
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Applied
#3 lore raw
In reply to Brad Smith

Thanks, applied.

Quoted 30 lines · Brad Smith

As reported in bug 1087114 the semaphores fallback code is broken which results in QEMU crashing and making QEMU unusable.

This patch is from Paolo.

This needs to be back ported to the 1.3 stable tree as well.

util/qemu-thread-posix.c +1 -1
index 7be292e..17f2d7c 100644
@@ -213,6 +213,7 @@ int qemu_sem_timedwait(QemuSemaphore *sem, int ms)
     while (sem->count < 0) {
         rc = pthread_cond_timedwait(&sem->cond, &sem->lock, &ts);
         if (rc == ETIMEDOUT) {
+            ++sem->count;
             break;
         }
         if (rc != 0) {
 
--

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.