Nvidia-dkms: DKMS installation exits with Error 139 (Segfault) [Temporal Fix available]

After updating my system, nvidia-dkms was unable to compile exiting with Error 139 (as shown in the logs bellow):

$ cat /var/lib/dkms/nvidia/555.52.04/build/make.log

make[3]: *** [scripts/Makefile.modfinal:60: /var/lib/dkms/nvidia/555.52.04/build/nvidia-peermem.ko] Error 139
make[3]: *** Deleting file '/var/lib/dkms/nvidia/555.52.04/build/nvidia-peermem.ko'
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/lib/modules/6.6.32-2-cachyos-lts-lto/build/Makefile:1849: modules] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/lib/modules/6.6.32-2-cachyos-lts-lto/build'
make: *** [Makefile:89: modules] Error 2

(This also happens with old nvidia packages (550.xx.xx, 545.xx.xx, 555.xx.xx and probably others))

Reading trough the output of dmesg I found this:

pahole[282600]: segfault at 8 ip 00007d3474a85b46 sp 00007fff38699cd8 error 6 in libdwarves.so.1.0.0[7d3474a50000+59000] likely on CPU 3 (core 3, socket 0)

To fix this I had to downgrade pahole from 1.27 to 1.26 and rerun the DKMS installation, refer to Dynamic Kernel Module Support - ArchWiki

I use Arch Linux but my system is using CachyOS packages. Because of that I prefer to report this issue here instead of Arch forum.


the problem is actually using the LTO kernel, which appears to be broken with the latest pahole. We have reported and also someone from clangbuiltlinux has bisected the issue.

1 Like