RE: NULL pointer in proc_pid_stat -- oops.

From: Andrew Reiter
Date: Tue Mar 30 2004 - 12:13:40 EST

Oops, I was getting confused since proc_pid_status() is directly above
proc_pid_stat() in fs/proc/array.c, so I misinterpreted some of the
asm<-->C translation and was stating we were dying in task_name().
Sorry for the confusion. Will apply Ricky's patch for now as a work
around as it seems fine to me for the moment.

Thanks for the help...


-----Original Message-----
From: OGAWA Hirofumi [mailto:hirofumi@xxxxxxxxxxxxxxxxxx]
Sent: Sunday, March 28, 2004 9:00 AM
To: Andrew Reiter
Cc: linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: NULL pointer in proc_pid_stat -- oops.

"Andrew Reiter" <areiter@xxxxxxxxxxxxxx> writes:

> 0x000004d4 <proc_pid_stat+124>: test %ecx,%ecx
> 0x000004d6 <proc_pid_stat+126>: je 0x510 <proc_pid_stat+184>
> 0x000004d8 <proc_pid_stat+128>: mov 0x98(%ecx),%eax
> 0x000004de <proc_pid_stat+134>: mov %eax,0x20(%esp,1)
> 0x000004e2 <proc_pid_stat+138>: mov 0x4(%ecx),%edx
> 0x000004e5 <proc_pid_stat+141>: movswl 0x64(%edx),%eax
> 0x000004e9 <proc_pid_stat+145>: movswl 0x66(%edx),%edx
> 0x000004ed <proc_pid_stat+149>: shl $0x14,%eax
> 0x000004f0 <proc_pid_stat+152>: or %edx,%eax
> 0x000004f2 <proc_pid_stat+154>: add 0x8(%ecx),%eax
> And from the oops trace output (that is attached), we can see that
> 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.
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at