nvidia machdep.c patch still useful ?

Andrew Atrens atrens at nortelnetworks.com
Thu Apr 1 07:41:59 PST 2004


My apologies if this has already been discussed but ...

There is a patch in the nvidia driver distribution that looks like so -

Index: machdep.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v
retrieving revision 1.385.2.28
diff -d -u -r1.385.2.28 machdep.c
--- machdep.c   22 Jan 2003 20:14:52 -0000      1.385.2.28
+++ machdep.c   8 May 2003 20:05:06 -0000
@@ -742,8 +742,6 @@
        regs->tf_cs = _ucodesel;
        regs->tf_ds = _udatasel;
        regs->tf_es = _udatasel;
-       regs->tf_fs = _udatasel;
-       load_gs(_udatasel);
        regs->tf_ss = _udatasel;
 }


The explanation reads -

Q: Why do KDE applications crash on exit?

A: The FreeBSD signal handler resets the %gs segment register,
   which prevents OpenGL from properly accessing data during shutdown
   from a signal handler.  To fix this problem on a -STABLE kernel,
   you can apply this patch:

    /usr/X11R6/share/doc/NVIDIA/machdep.c.diff

   to sys/i386/i386/machdep.c and rebuild your kernel.

   The patch can be applied like this:

    cd /usr/src/sys/i386/i386/
    patch -p0 -i /usr/X11R6/share/doc/NVIDIA/machdep.c.diff

   This change has already been made in recent -CURRENT kernel sources.


Interestingly I do see some of my KDE apps segfaulting on exit. Not sure
if it's the same issue, but when I apply the patch the segfaulting stops.
Unfortunately during my tests my X display locked up after a short while -
hence my question to the list. I guess to really figure this out I need 
to get a serial console going ...

Andrew.








More information about the Kernel mailing list