Xorg present flip failed · uwot.eu
another meaningless subtitle

Xorg present flip failed

· by fabio · Read in about 5 min · (1043 Words)
Fedora Xorg PageFlip Double Buffering

In the last couple of months Xorg has been crashing more or less on a daily basis.
What happens is that while you are there browsing the internet, or certain times even doing literally nothing, Xorg crashes and after a second of black screen the user is sent back to the login page.
Hardware configuration of my machine is:

CPU:            AMD Ryzen 7 1700x
Motherboard:    Gigabyte X370 K7 - BIOS F23d
RAM:            2x16 GB DDR4
HDD:            Samsung 850 Pro
GPU:            Nvidia GTX260

Monitor 0:     Dell U2412M connected via DVI-D
Monitor 1:     Dell U2412M connected via HDMI-DVI cable

OS:             Fedora 28 and Fedora 29 x86_64
GPU driver:     nouveau, various versions
others:         varius versions of Linux, Xorg, mesa, etc

I don’t think having two monitors is the culprit nor using a very old Nvidia graphic card is because a friend of mine runs a completely different system (AMD Radeon RX480, single monitor connected using Display Port) and still suffer from the very same problem.
Upgrading from Fedora 28 to Fedora 29 nor installing updates in a timely manner solved the issue for me; searching on the interwebz also did not yeld any result.
After yet another crash, today I finally decided it was time to investigate the issue.
First thing I noticed is that Xorg log file is literally spammed with the following error:

cat /var/log/Xorg.0.log
---
[ 19911.425] (EE) modeset(0): Failed to get GBM bo for flip to new front.
[ 19911.425] (EE) modeset(0): present flip failed
---

These two lines are repeated forever with multiple entries being added every second.
Using journalctl to debug the system right after the infamous Xorg crash occurs gives the following error:

Nov 17 14:24:08 hostname audit[4987]: ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:xserver_t:s0-s0:c0.c1023 pid=4987 comm="Xorg" exe="/usr/libexec/Xorg" sig=6 res=1
Nov 17 14:24:08 hostname systemd[1]: Created slice system-systemd\x2dcoredump.slice.
Nov 17 14:24:08 hostname systemd[1]: Started Process Core Dump (PID 8334/UID 0).
Nov 17 14:24:08 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@0-8334-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 17 14:24:09 hostname xfce4-notifyd[5952]: xfce4-notifyd: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Nov 17 14:24:09 hostname pulseaudio[5378]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
Nov 17 14:24:09 hostname pulseaudio[5378]:       after 17 requests (17 known processed) with 0 events remaining.
Nov 17 14:24:09 hostname polkitd[4874]: Unregistered Authentication Agent for unix-session:2 (system bus name :1.225, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf8) (disconnected from bus)
Nov 17 14:24:09 hostname Thunar[6022]: Thunar: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
Nov 17 14:24:09 hostname at-spi-bus-launcher[5697]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Nov 17 14:24:09 hostname at-spi-bus-launcher[5697]:       after 19727 requests (19727 known processed) with 0 events remaining.
Nov 17 14:24:09 hostname systemd[5358]: xfce4-notifyd.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 14:24:09 hostname systemd[5358]: xfce4-notifyd.service: Failed with result 'exit-code'.
Nov 17 14:24:09 hostname systemd[5358]: pulseaudio.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 14:24:09 hostname systemd[5358]: pulseaudio.service: Failed with result 'exit-code'.
Nov 17 14:24:09 hostname audit[5321]: USER_LOGOUT pid=5321 uid=0 auid=1000 ses=2 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=logout id=1000 exe="/usr/sbin/lightdm" hostname=hostname addr=? terminal=/dev/tty1 res=success'
Nov 17 14:24:09 hostname systemd[5358]: thunar.service: Main process exited, code=exited, status=1/FAILURE
Nov 17 14:24:09 hostname systemd[5358]: thunar.service: Failed with result 'exit-code'.
Nov 17 14:24:09 hostname audit[5321]: USER_END pid=5321 uid=0 auid=1000 ses=2 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_selinux,pam_loginuid,pam_selinux,pam_keyinit,pam_namespace,pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_gnome_keyring,pam_lastlog,pam_umask,pam_lastlog acct="username" exe="/usr/sbin/lightdm" hostname=? addr=? terminal=:0 res=success'
Nov 17 14:24:09 hostname lightdm[5321]: pam_unix(lightdm:session): session closed for user username
Nov 17 14:24:09 hostname audit[6236]: USER_END pid=6236 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
Nov 17 14:24:09 hostname audit[5321]: CRED_DISP pid=5321 uid=0 auid=1000 ses=2 subj=system_u:system_r:xdm_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_localuser,pam_unix,pam_gnome_keyring acct="username" exe="/usr/sbin/lightdm" hostname=? addr=? terminal=:0 res=success'
Nov 17 14:24:09 hostname audit[6236]: CRED_DISP pid=6236 uid=0 auid=1000 ses=2 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_localuser,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/1 res=success'
Nov 17 14:24:09 hostname sudo[6236]: pam_unix(sudo:session): session closed for user root
Nov 17 14:24:09 hostname libvirtd[4943]: 2018-11-17 13:24:09.244+0000: 4943: info : libvirt version: 4.7.0, package: 1.fc29 (Fedora Project, 2018-09-04-10:29:06, )
Nov 17 14:24:09 hostname libvirtd[4943]: 2018-11-17 13:24:09.244+0000: 4943: info : hostname: hostname
Nov 17 14:24:09 hostname libvirtd[4943]: 2018-11-17 13:24:09.244+0000: 4943: error : virNetSocketReadWire:1805 : End of file while reading data: Input/output error
Nov 17 14:24:09 hostname systemd-logind[4798]: Session 2 logged out. Waiting for processes to exit.
Nov 17 14:24:09 hostname systemd[5358]: pulseaudio.service: Service RestartSec=100ms expired, scheduling restart.
Nov 17 14:24:09 hostname systemd[5358]: pulseaudio.service: Scheduled restart job, restart counter is at 1.
Nov 17 14:24:09 hostname systemd[5358]: Stopped Sound Service.
Nov 17 14:24:09 hostname systemd[5358]: Starting Sound Service...
Nov 17 14:24:09 hostname rtkit-daemon[4788]: Successfully made thread 8338 of process 8338 (/usr/bin/pulseaudio) owned by '1000' high priority at nice level -11.
Nov 17 14:24:09 hostname rtkit-daemon[4788]: Supervising 1 threads of 1 processes of 1 users.
Nov 17 14:24:09 hostname pulseaudio[8338]: W: [pulseaudio] pid.c: Stale PID file, overwriting.
Nov 17 14:24:09 hostname systemd-coredump[8335]: Process 4987 (Xorg) of user 0 dumped core.
                                              
                                              Stack trace of thread 4987:
                                              #0  0x00007fafa083053f raise (libc.so.6)
                                              #1  0x00007fafa081a895 abort (libc.so.6)
                                              #2  0x000055f8897e1d30 OsAbort (Xorg)
                                              #3  0x000055f8897e78f9 n/a (Xorg)
                                              #4  0x000055f8897e876d FatalError (Xorg)
                                              #5  0x000055f8897df035 n/a (Xorg)
                                              #6  0x00007fafa09d0f70 __restore_rt (libpthread.so.0)
                                              #7  0x00007faf9ff9bfa1 n/a (libglamoregl.so)
                                              #8  0x00007faf9ffa6b48 n/a (libglamoregl.so)
                                              #9  0x00007faf9ffa6f48 n/a (libglamoregl.so)
                                              #10 0x00007faf9ffa758e n/a (libglamoregl.so)
                                              #11 0x00007faf9ffa958c n/a (libglamoregl.so)
                                              #12 0x000055f8897603df n/a (Xorg)
                                              #13 0x000055f889754140 n/a (Xorg)
                                              #14 0x000055f88967ed7e n/a (Xorg)
                                              #15 0x000055f889682dc6 n/a (Xorg)
                                              #16 0x00007fafa081c413 __libc_start_main (libc.so.6)
                                              #17 0x000055f88966c7be _start (Xorg)
                                              
                                              Stack trace of thread 5134:
                                              #0  0x00007fafa08f58c7 epoll_wait (libc.so.6)
                                              #1  0x000055f8897df9db n/a (Xorg)
                                              #2  0x000055f8897dd1de n/a (Xorg)
                                              #3  0x00007fafa09c658e start_thread (libpthread.so.0)
                                              #4  0x00007fafa08f5593 __clone (libc.so.6)
                                              
                                              Stack trace of thread 5121:
                                              #0  0x00007fafa09cc67c pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                                              #1  0x00007faf9f365033 n/a (nouveau_dri.so)
                                              #2  0x00007faf9f364d8b n/a (nouveau_dri.so)
                                              #3  0x00007fafa09c658e start_thread (libpthread.so.0)
                                              #4  0x00007fafa08f5593 __clone (libc.so.6)
Nov 17 14:24:09 hostname rtkit-daemon[4788]: Supervising 1 threads of 1 processes of 1 users.

I have no idea how to solve this, but at least I managed to stop Xorg from spamming the log with retarded errors.
To do that create a xorg.conf file:

$ Xorg :1 -configure
$ mv /root/xorg.conf.new /etc/X11/xorg.conf

Edit xorg.conf and uncomment the following line to disable double buffering:

$ vi /etc/X11/xorg.conf
---
Section "Device"
        ### SOME STUFF
        Option     "PageFlip"                   "False"
        ### SOME MORE STUFF
EndSection

I will update the post in a couple of days, hopefully no more crashes.

.:. UPDATE

Since I disabled double buffering I never had a single crash, so if you can live without it go ahead and disable it.