Linus Torvalds wrote:
Ok, I'm a bit bitter, because I just spent a long time chasing down a kernel bug that didn't turn out to be a kernel bug at all.

I started seeing that strange SIGSEGV with programs that use dri, and it
happened right after the SIGFPE that tested for XMM support. As it
happens, I've done some signal delivery changes in the kernel lately, so I
blamed myself.

It wasn't my fault.

That frigging Mesa assembly-code is broken. In particular, it undoes the
whole stack frame _before_ it does the divide-by-zero thing, yet it still
has stuff in the local frame. Signal delivery will overwrite the local
frame if the stack is aligned just the right way, and as a result the
LDMXCSR that follows the DIVPS will load crap into MXCSR. And the crap it
loads may well cause a SIGSEGV due to a GP-fault by the CPU.

Grr. Double-grr. That assembly-language is written in some unreadable syntax anyway, but here's a totally untested diff that may fix the crap by de-allocating the stack only after we're actually _done_ with it.

I was too lazy to check whether the other asm routines were similarly broken. Anyway, the rule is:
YOU MUST NOT USE LOCATIONS ON THE STACK UNDER THE STACK POINTER

Ok, I feel better now after that rant. Sorry,
Thanks for the patch. I've checked in the change to all the relevant trees.
From the CVS logs, it looks like this problem was introduced by a patch from June 2002.

-Brian



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel


Reply via email to