kvm: user: Call pthread_join only to created threads.
PATCH 1/1 kvm: user: Call pthread_join only to created threads.
Hi,
This patch fixes a bug in kvmtrace.
Thanks,
ozaki-r
Quoted 1 line
From
4ccee3a01c2e8c377dc6a760b5d7802e58afda72Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <[email protected]>
Date: Sat, 4 Oct 2008 15:30:48 +0900
Subject: [PATCH] kvm: user: Call pthread_join only to created threads.
If thread_main fails with a somewhat reason (e.g. open fails) before all threads are created, pthread_join is called to a uncreated thread and a segmentation fault occurs.
This patch checks whether a thread is created before calling pthread_join to the thread.
--- user/kvmtrace.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
user/kvmtrace.c +2 -1
@@ -454,7 +454,8 @@ static void stop_threads()int i;for_each_tip (tip, i) { - (void )pthread_join (tip->thread, (void *) &ret); +if (tip->thread) + (void )pthread_join (tip->thread, (void *) &ret);close_thread (tip); } }
Signature · 1 line
1.5.4.1
Avi Kivity
AppliedQuoted 12 lines · Ryota OZAKI
Hi,
This patch fixes a bug in kvmtrace.
Thanks,
ozaki-rFrom
4ccee3a01c2e8c377dc6a760b5d7802e58afda72Mon Sep 17 00:00:00 2001
From: Ryota Ozaki <[email protected]>
Date: Sat, 4 Oct 2008 15:30:48 +0900
Subject: [PATCH] kvm: user: Callpthread_joinonly to created threads.
Quoted 8 lines
If
thread_mainfails with a somewhat reason (e.g. open fails) before all threads are created,pthread_joinis called to a uncreated thread and a segmentation fault occurs.This patch checks whether a thread is created before calling
pthread_jointo the thread.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function