Skip to contentSkip to conversation

regression introduced by - timers: fix itimer/many thread hang

DISCUSSION Oleg Nesterov 1 participant 1 message Nov 6, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines

Begin forwarded message:

Quoted 11 lines · Doug Chapman
Quoted 9 lines · Frank Mayhar
Quoted 2 lines · Doug Chapman
Unable to handle kernel paging request at virtual address

94949494949494a4

I take it this can be read as an uninitialized (or cleared) pointer?

It certainly looks like this is a race in thread (process?) teardown. I don't have hardware on which to reproduce this but _looks_ like another thread has gotten in and torn down the process while we've been busy.

Quoted 6 lines

I finally managed to get kdump working and caught this in the act. I still need to dig into this more but I think these 2 threads will show us the race condition. Note that this is a slightly hacked kernel in that I removed "static" from a few functions to better see what was going on but no real functional changes when compared to a recent (day old or so) git pull from Linus's tree.

Quoted 9 lines

After digging through this a bit, I've concluded that it's probably a race between process reap and the dequeue_entity() call to update_curr() combined with a side effect of the slab debug stuff. The account_group_exec_runtime() routine (like the rest of these routines) checks tsk->signal and tsk->signal->cputime.totals for NULL to make sure they're still valid. It looks like at this point tsk->signal is valid (since the tsk->signal->cputime dereference succeeded) but tsk->signal->cputime.totals is invalid. That can't happen unless the process is being reaped,

Frank, currently I don't have the source code which I can look at, so I am probably wrong... But just in case, perhaps we can do

	-	account_group_exec_runtime(...);
	+	if (lock_task_sighand(...)) {
	+		account_group_exec_runtime(...);
	+		unlock_task_sighand();
	+	}

?

Once we take ->siglock the task can't be reaped, and ->signal becomes stable and != NULL.

Oleg.