[PATCH] utrace_stop: don't forget about SIGNAL_STOP_STOPPED

Oleg Nesterov oleg at redhat.com
Tue Jul 28 20:27:41 UTC 2009


utrace_stop() decrements ->group_stop_count but doesn't set
SIGNAL_STOP_STOPPED if we are the last thread. This breaks
utrace_wakeup() logic.

Perhaps we need more changes here, but I think this one is
most important.

Signed-off-by: Oleg Nesterov <oleg at redhat.com>

--- __UTRACE/kernel/utrace.c~UTRACE_STOP_SSS	2009-07-28 21:55:43.000000000 +0200
+++ __UTRACE/kernel/utrace.c	2009-07-28 22:12:44.000000000 +0200
@@ -416,8 +416,9 @@ static bool utrace_stop(struct task_stru
 	 * If there is a group stop in progress,
 	 * we must participate in the bookkeeping.
 	 */
-	if (task->signal->group_stop_count > 0)
-		--task->signal->group_stop_count;
+	if (unlikely(task->signal->group_stop_count) &&
+			!--task->signal->group_stop_count)
+		task->signal->flags = SIGNAL_STOP_STOPPED;
 
 	spin_unlock_irq(&task->sighand->siglock);
 	spin_unlock(&utrace->lock);




More information about the utrace-devel mailing list