Nvidia Geforce 4xx series drivers segfault with kernel-4.19.x

Running Slackware64-current with the Plasma5 KDE version. After upgrading to kernel-4.19.(1) the 400 series drivers segfault on startx. I have tried all four of them including the newest beta version. The drivers build fine but when I startx I get the following segfault -

tom@missi:~$ startx
xauth: file /home/tom/.serverauth.19384 does not exist

X.Org X Server 1.20.3
X Protocol Version 11, Revision 0
Build Operating System: Slackware 15.0 Slackware Linux Project
Current Operating System: Linux missi.quickline.ch 4.19.1 #1 SMP Thu Nov 8 05:57:03 CET 2018 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.19.1 root=/dev/md0 ro
Build Date: 25 October 2018 01:30:15PM

Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.0.log”, Time: Sat Nov 10 09:31:47 2018
(==) Using config file: “/etc/X11/xorg.conf”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
(EE)
(EE) Backtrace:
(EE) 0: /usr/libexec/Xorg (OsLookupColor+0x139) [0x58c349]
(EE) 1: /lib64/libpthread.so.0 (funlockfile+0x50) [0x7fb54db225ff]
(EE) 2: /usr/lib64/xorg/modules/extensions/libglx.so (GlxSetVisualConfigs+0x4cc) [0x7fb54c85fbdc]
(EE) 3: /usr/lib64/xorg/modules/extensions/libglx.so (_init+0x193f2) [0x7fb54c878272]
(EE) 4: /usr/lib64/xorg/modules/extensions/libglx.so (_init+0x187fa) [0x7fb54c876aea]
(EE) 5: /usr/libexec/Xorg (InitExtensions+0x89) [0x4a8dd9]
(EE) 6: /usr/libexec/Xorg (InitFonts+0x1db) [0x442f4b]
(EE) 7: /lib64/libc.so.6 (__libc_start_main+0xeb) [0x7fb54d74b3db]
(EE) 8: /usr/libexec/Xorg (_start+0x2a) [0x42de4a]
(EE)
(EE) Segmentation fault at address 0x7fb54c809138
(EE)
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE)
(EE)
Please consult the The X.Org Foundation support
at http://wiki.x.orgfor help.
(EE) Please also check the log file at “/var/log/Xorg.0.log” for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

The NVIDIA-Linux-x86_64-390.87 driver works fine after patching with this patch -

diff -ur NVIDIA-Linux-x86_64-396.24/kernel/nvidia-drm/nvidia-drm-connector.c NVIDIA-Linux-x86_64-396.24.patched2/kernel/nvidia-drm/nvidia-drm-connector.c
— NVIDIA-Linux-x86_64-396.24/kernel/nvidia-drm/nvidia-drm-connector.c 2018-04-26 10:34:46.000000000 +0200
+++ NVIDIA-Linux-x86_64-396.24.patched2/kernel/nvidia-drm/nvidia-drm-connector.c 2018-08-22 15:42:15.327407716 +0200
@@ -226,7 +226,7 @@

 if (nv_connector->edid != NULL) {
  •    drm_mode_connector_update_edid_property(
    
  •    drm_connector_update_edid_property(
           connector, nv_connector->edid);
    
    }

diff -ur NVIDIA-Linux-x86_64-396.24/kernel/nvidia-drm/nvidia-drm-encoder.c NVIDIA-Linux-x86_64-396.24.patched2/kernel/nvidia-drm/nvidia-drm-encoder.c
— NVIDIA-Linux-x86_64-396.24/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-04-26 10:34:46.000000000 +0200
+++ NVIDIA-Linux-x86_64-396.24.patched2/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-08-22 15:41:25.356410694 +0200
@@ -216,7 +216,7 @@

 /* Attach encoder and connector */
  • ret = drm_mode_connector_attach_encoder(connector, encoder);
  • ret = drm_connector_attach_encoder(connector, encoder);

    if (ret != 0) {
    NV_DRM_DEV_LOG_ERR(

Can anyone see what the problem is?? I’m running a GTX970 card. Thanks in advance

Same issue here. Exact same crash message and addresses. The last driver that works is 396.

System:

Dual Intel Xeon E5-2670
Nvidia 1060i 6GB
Ubuntu 18.10
KDE Plasma 5.13
Kernel Version 4.18.0
xserver-xorg 2:1.20.1

I should also note that the 4.10 drivers already include the changes above but this message is still appearing.

Update: So I figured I’d actually try reverting these changes by using the kernel supplied drm_mode functions in 4.10. However, this did not resolve the problem and I still have the exact same crash message. Looks like I am stuck on 396.xx for now.

This is resolved, thanks to NVidia support. They noted that after 396, the installer no longer installs a copy of the libglx.so into /usr/lib/xorg/modules/extensions/. For me, when I installed any later versions of the driver, it restored an older version of this library that no longer matched the Xorg server version. I simply had to force a reinstall of the xorg-server-core package after installing the latest NVidia driver.