At first glance this seems a miscompilation, a compiler bug, not bug in
2.4.19pre9aa2 (this clearly explains why you're the only one reproducing
this weird oops). it even sounds like ksymoops is buggy, ksymoops had to
say c0147dad (+7d), not c0147dac and +7c (maybe you compiled ksymoops
with the same compiler of the kernel? If not Keith should have a look
here).
besides the stupid zeroing of 0x14(esp) (my compiler isn't doing that),
the initial sub seems wrong, pipe_wait has just one argument, and that's
at offset 0x34, so it should be sub 0x30, not sub 0x20, or we will
corrupt the underlying stack and we also won't read the
inode at all (hence the oops, it wasn't the inode to be corrupted as I
guessed in the previous email, it's at the previous setp, we use random
memory as a pointer to the inode structure so we oops while we try to
read the inode contents).
Of course the code reads the inode at offset 0x34, but at 0x34 there's
not the inode, there's something else random, because the prologue did
sub 0x20 so the inode was at 0x24, not 0x34! the prologue clearly had to
do sub 0x30 instead (that's the miscompilation).
What compiler are you using? Maybe 2.96?
3.1.1 20020530 works fine for me with the kernel, as well as previous
gcc 3.1, never had a single problem with the kernel in the whole
developement cycle of 3.0 and 3.1 and now with 3.1.1. If you need to go
safe with the kernel for x86 you should use only 2.95 or egcs 1.1.2,
however I can reassure people that gcc 3.1.1 seems rock solid even if
I wouldn't use it in mission critical yet.
I CC'ed Honza (x86-64/x86 gcc guru) and Keith, in case I misread something.
Honza, this is the pipe_wait C code:
void pipe_wait(struct inode * inode)
{
DECLARE_WAITQUEUE(wait, current);
current->state = TASK_INTERRUPTIBLE;
add_wait_queue(PIPE_WAIT(*inode), &wait);
^^^^^^^^^^^^^^^^^ we bug here while dereferencing inode->i_pipe
up(PIPE_SEM(*inode));
schedule();
remove_wait_queue(PIPE_WAIT(*inode), &wait);
current->state = TASK_RUNNING;
down(PIPE_SEM(*inode));
}
note, wait is at offset 0 of i_pipe, and i_pipe is at offset 0xf8 of the
inode. So it is indeed doing inode->i_pipe when it oops, because the
inode address passed on the stack (first and only argument) was at 0x24 not 0x34.
> 0xc0147db3 <pipe_wait+131>: mov %ebp,%edx
> 0xc0147db5 <pipe_wait+133>: call 0xc0119a28 <remove_wait_queue>
> 0xc0147dba <pipe_wait+138>: movl $0x0,(%ebx)
> 0xc0147dc0 <pipe_wait+144>: mov %edi,%ecx
> 0xc0147dc2 <pipe_wait+146>: lock decl 0x6c(%esi)
> 0xc0147dc6 <pipe_wait+150>: js 0xc0148925 <.text.lock.pipe+10>
> 0xc0147dcc <pipe_wait+156>: pop %ebx
> 0xc0147dcd <pipe_wait+157>: pop %esi
> 0xc0147dce <pipe_wait+158>: pop %edi
> 0xc0147dcf <pipe_wait+159>: pop %ebp
> 0xc0147dd0 <pipe_wait+160>: add $0x20,%esp
> 0xc0147dd3 <pipe_wait+163>: ret
> End of assembler dump.
>
> > not really sure what could be the problem, it would be interesting to
> > see if you can reproduce it. Also if for example you enabled numa-q you
> > may want to try to disable it and see if w/o discontigmem the problem
> > goes away, if we could isolate it to a config option, it would help a lot.
>
> OK, I'll play around some more and try to build up a pattern.
>
> Not sure why ksymoops is printing c0147dac from the trace, whilst
> the stack says c0147dad, which seems to be the schedule call -
> would make sense, as that's what you just changed?
yes, that's wrong, but that is a ksymoops mistake not related to the
original oops (possibly due the same broken compiler but maybe not).
>
> M.
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/