Arch Linux - Fixing segfaults with Skylake in glibc
2 min read
There have been some problems with Skylake processors segfaulting (usually with media applications). On my i7 6700k, for example, I get this when trying to start VLC:
VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1-0-ga425c42)
Segmentation fault (core dumped)
Tracking down the segfault leads to somewhere in glibc. At first I thought it was the NVIDIA driver since it crashes there, but it's actually more likely an issue with the microcode in the cpu. See:
- Phoronix: NVIDIA's Latest Binary Driver Is Causing Problems For Some Skylake Linux Users. The article itself is wrong; I actually get this even without the NVIDIA proprietary driver installed.
- Arch BBS: [SOLVED] Broadwell 5675c elision crash
- Intel Skylake bug causes PCs to freeze during complex workloads. As mentioned in this article, reminds me of the lock ellision bug of previous generations.
- We Saw Some Really Bad Intel CPU Bugs in 2015, and We Should Expect to See More in the Future
Fixing it
Just recompile glibc
with lock elision disabled. Whenever there is a glibc
update I just run this script to rebuild it. It'll take awhile if you haven't setup makepkg
to use multiple cores.
#!/bin/sh
sudo abs
rm -rf /tmp/glibc
mkdir /tmp/glibc
pushd /tmp/glibc
cp -r /var/abs/core/glibc .
sed -i '/--enable-lock-elision/d' glibc/PKGBUILD
cd glibc
makepkg -ci
popd
As usual you may need to import missing keys into your keyring to build.