Re: kernel BUG at kernel/exit.c:792!

From: Ingo Molnar
Date: Wed Dec 03 2003 - 15:33:49 EST



i didnt notice the pid_alive() check within the loop - it's incorrect. If
we are within the tasklist lock and the thread group leader is valid then
the thread chain should be fully intact. The patch that i believe fixes
the bug the right way is below.

Ingo

--- linux/fs/proc/base.c.orig
+++ linux/fs/proc/base.c
@@ -1666,10 +1666,14 @@ static int get_tid_list(int index, unsig

index -= 2;
read_lock(&tasklist_lock);
- do {
+ /*
+ * The starting point task (leader_task) might be an already
+ * unlinked task, which cannot be used to access the task-list
+ * via next_thread().
+ */
+ if (pid_alive(task)) do {
int tid = task->pid;
- if (!pid_alive(task))
- continue;
+
if (--index >= 0)
continue;
tids[nr_tids] = tid;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/