Re: PANIC in check_process_timers() running 2.6.11-rc2-mm1

From: Roland McGrath
Date: Tue Jan 25 2005 - 17:19:33 EST


Thanks for tracking that down. It was intended that such things would not
be possible because getting into that code in the first place should be
ruled out while exiting. That removes the requirement for any special case
check in the common path. But, it was done too late since it hadn't
occurred to me that ->live going zero itself created a problem.

Please try this patch instead of the one you posted. This patch goes on
top of all the patches I posted, and so should apply to -mm1 fine. But
because the context nearby changes a lot in the various patches, this one
won't apply after just the cputimers patch without the succeeding three.

Andrew, if you prefer, I can send a replacement for the cputimers patch
that includes this fix, and replacements for the three later patches that
will apply after that one. If you use this patch, make sure it goes after
the three later patches (itimers and sigxcpu).


Thanks,
Roland

Signed-off-by: Roland McGrath <roland@xxxxxxxxxx>

--- linux-2.6/kernel/exit.c
+++ linux-2.6/kernel/exit.c
@@ -753,14 +753,6 @@ static void exit_notify(struct task_stru
state = EXIT_DEAD;
tsk->exit_state = state;

- /*
- * Clear these here so that update_process_times() won't try to deliver
- * itimer, profile or rlimit signals to this task while it is in late exit.
- */
- tsk->it_virt_expires = cputime_zero;
- tsk->it_prof_expires = cputime_zero;
- tsk->it_sched_expires = 0;
-
write_unlock_irq(&tasklist_lock);

list_for_each_safe(_p, _n, &ptrace_dead) {
@@ -801,6 +793,14 @@ fastcall NORET_TYPE void do_exit(long co

tsk->flags |= PF_EXITING;

+ /*
+ * Make sure we don't try to process any timer firings
+ * while we are already exiting.
+ */
+ tsk->it_virt_expires = cputime_zero;
+ tsk->it_prof_expires = cputime_zero;
+ tsk->it_sched_expires = 0;
+
if (unlikely(in_atomic()))
printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n",
current->comm, current->pid,
-
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/