Skip to contentSkip to conversation

Fix suspend with traced tasks

PATCH New Pavel Machek 1 participant 1 message Mar 29, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix suspend with traced tasks

strace /bin/bash misbehaves after resume; this fixes it.

kernel/power/process.c +1 -2
index 8ac7c35..b2a5f67 100644
@@ -26,8 +26,7 @@ static inline int freezeable(struct task
 	    (p->flags & PF_NOFREEZE) ||
 	    (p->exit_state == EXIT_ZOMBIE) ||
 	    (p->exit_state == EXIT_DEAD) ||
-	    (p->state == TASK_STOPPED) ||
-	    (p->state == TASK_TRACED))
+	    (p->state == TASK_STOPPED))
 		return 0;
 	return 1;
 }
kernel/signal.c +1 -0
index 6b5037a..185b13e 100644
@@ -1689,6 +1689,7 @@ static void ptrace_stop(int exit_code, i
 	/* Let the debugger run.  */
 	set_current_state(TASK_TRACED);
 	spin_unlock_irq(&current->sighand->siglock);
+	try_to_freeze();
 	read_lock(&tasklist_lock);
 	if (likely(current->ptrace & PT_PTRACED) &&
 	    likely(current->parent != current->real_parent ||
Signature · 1 line
Picture of sleeping (Linux) penguin wanted...