Subject: Re: NULL pointer in proc_pid_stat -- oops.

From: Albert Cahalan
Date: Sun Mar 28 2004 - 20:33:05 EST


>> And from the oops trace output (that is attached), we can
>> see that %edx is 0x0; so we can easily see here why we're
>> crashing at least. After examining the C source, I see
>> that we're dying in the call to task_name() (inline) from
>> proc_pid_stat().
>
> Looks like this problem is same with BSD acct Oops.
>
> if (task->tty) {
> tty_pgrp = task->tty->pgrp;
> tty_nr = new_encode_dev(tty_devnum(task->tty));
> }
>
> Some place doesn't take the any lock for ->tty.
> I think we need to take the lock for ->tty.

Probably this isn't the thing for 2.6.xx, but how
about a special tty struct instead of the NULL?
Make it const, perhaps write-protected, etc.

Then the if(task->tty) test can be removed.


-
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/