Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 597072 - x11-drivers/xf86-video-intel - Switching VTs from fbi to X causes X server to crash
Summary: x11-drivers/xf86-video-intel - Switching VTs from fbi to X causes X server to...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 20:53 UTC by Jonathan Lovelace
Modified: 2018-11-27 22:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Xorg log after the crash (Xorg.0.log,6.79 KB, text/plain)
2016-10-13 20:53 UTC, Jonathan Lovelace
Details
Xorg log when xf86-video-intel USE=debug (Xorg.0.log,6.86 KB, text/plain)
2017-11-10 07:32 UTC, Jonathan Lovelace
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Lovelace 2016-10-13 20:53:44 UTC
Created attachment 450178 [details]
Xorg log after the crash

If I switch away from X to a virtual terminal using CTRL-ALT-Fn and, in a virtual terminal, use fbi to view an image, and then try to switch back to X using ALT-Fn, I invariably find that the X server has crashed. If I don't run fbi, or if I exit fbi before switching back, X does not crash.

When this crash happens, something like the following appears in /var/log/Xorg.0.log:
[247836.141] (II) AIGLX: Resuming AIGLX clients after VT switch
[247838.256] (EE)
Fatal server error:
[247838.257] (EE) EnterVT failed for screen 0
[247838.257] (EE)
[247838.257] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[247838.257] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[247838.257] (EE)
[247838.257] (II) AIGLX: Suspending AIGLX clients for VT switch
[247838.257] (WW) intel(0): drmDropMaster failed: Invalid argument
[247838.262] (EE) Server terminated with error (1). Closing log file.

That file is then replaced with another, which I have attached.

I'm running a hardened system, with VIDEO_CARDS="fbdev intel".

emerge --info fbida xf86-video-intel xf86-video-fbdev xorg-server xorg-drivers:
Portage 2.3.0 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.22-r4, 4.4.8-hardened-r1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.4.8-hardened-r1-x86_64-Intel-R-_Core-TM-_i5-2400_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:     8072720 total,   1680504 free
KiB Swap:   13029364 total,  12972252 free
Timestamp of repository gentoo: Wed, 12 Oct 2016 00:45:01 +0000
sh bash 4.3_p48
ld GNU ld (Gentoo 2.24 p1.4) 2.24
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p48::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21.7::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.10.3-r1::gentoo, 1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://myrriddium.local/gentoo-portage
    priority: -1000

dlang
    location: /var/lib/layman/dlang
    sync-type: git
    sync-uri: https://github.com/gentoo/dlang.git
    masters: gentoo

eclipse
    location: /var/lib/layman/eclipse-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo/eclipse-overlay.git
    masters: gentoo

hossie
    location: /var/lib/layman/hossie
    sync-type: git
    sync-uri: https://git.hossie.de/scm/gen/gentoo-overlay.git
    masters: gentoo

localoverlay
    location: /usr/local/portage
    masters: gentoo lovelace dlang
    priority: 0

lovelace
    location: /var/lib/layman/lovelace
    masters: gentoo

science
    location: /var/lib/layman/science
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/sci.git
    masters: gentoo

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo

sunrise
    location: /var/lib/layman/sunrise
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/sunrise-reviewed.git
    masters: gentoo

Installed sets: @archivers, @backup-options, @classes, @devel, @dicts, @doc-conv, @docs, @emulation, @fonts, @kernels, @looked-interesting, @maintenance, @ocr, @office, @sp-devel
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -mtune=generic -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.1/conf /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=core2 -mtune=generic -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe -march=core2 -mtune=generic -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer"
FEATURES="assume-digests binpkg-logs candy collision-protect config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"
FFLAGS="-O2 -pipe -march=core2 -mtune=generic -fno-unwind-tables -fno-asynchronous-unwind-tables -fomit-frame-pointer"
GENTOO_MIRRORS="http://lug.mtu.edu/gentoo/ http://gentoo.osuosl.org/ http://gentoo.cites.uiuc.edu/pub/gentoo/ http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3 -l5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acpi alsa amd64 bash-completion berkdb bzip2 cddb cli cracklib crypt cxx dri gdbm hardened iconv ipv6 java java5 java6 jpeg justify libnotify libsecret lm_sensors mmx mmxext modules multilib ncurses nls nptl ogg openmp pam pax_kernel pcre pie png readline seccomp session sse sse2 sse3 sse4_1 sse4_2 ssl ssp ssse3 startup-notification tcpd theora truetype unicode urandom vorbis xattr xcomposite xdg xft xtpax xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="sheets words plan kexi braindump flow" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en_US en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="pdfimport" LINGUAS="en en_US" NETBEANS_MODULES="harness ide java nb javafx profile" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel fbdev i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

media-gfx/fbida-2.12::gentoo was built with the following:
USE="X fbcon gif png scanner tiff webp -curl -ghostscript -lirc" ABI_X86="64"


x11-base/xorg-server-1.18.4::gentoo was built with the following:
USE="ipv6 suid udev xorg xvfb -dmx -doc -glamor -kdrive (-libressl) -minimal (-selinux) -static-libs -systemd -tslib -unwind -wayland -xephyr -xnest" ABI_X86="64"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,lazy"


x11-base/xorg-drivers-1.18-r1::gentoo was built with the following:
USE="" ABI_X86="64" INPUT_DEVICES="evdev -acecad -aiptek -elographics -fpit -hyperpen -joystick -keyboard -libinput -mouse -mutouch -penmount -synaptics -tslib -vmmouse -void -wacom" VIDEO_CARDS="fbdev intel -amdgpu -apm -ast -chips -cirrus -dummy -epson -fglrx -freedreno -geode -glint -i128 -i740 -mach64 -mga -neomagic -nouveau -nv -nvidia -omap -omapfb -qxl -r128 -radeon -radeonsi -rendition -s3 -s3virge -savage -siliconmotion -sisusb -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tegra -tga -trident -tseng -vesa -via -virtualbox -vmware -voodoo"


x11-drivers/xf86-video-intel-2.99.917_p20160621-r1::gentoo was built with the following:
USE="dri sna udev xvmc -debug -dri3 -uxa" ABI_X86="64"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,lazy"


x11-drivers/xf86-video-fbdev-0.4.4::gentoo was built with the following:
USE="" ABI_X86="64"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,lazy"
Comment 1 Matt Turner gentoo-dev 2017-01-29 18:20:52 UTC
Please try the unstable version 2.99.917_p20161206 and report back.
Comment 2 Jonathan Lovelace 2017-02-01 01:25:34 UTC
Still happens with xf86-video-intel-2.99.917_p2016120.
Comment 3 EoD 2017-11-09 13:06:50 UTC
Did you try reporting the issue upstream?
https://bugs.freedesktop.org/enter_bug.cgi?product=DRI 
If you compile xf86-video-intel with USE=debug you will also get assertions which might help upstream to fix it.

Apart from that, there has been a (very) recent commit about EnterVT, maybe you are lucky: https://cgit.freedesktop.org/xorg/driver/xf86-video-intel/log/?qt=grep&q=EnterVT
Comment 4 Jonathan Lovelace 2017-11-10 07:31:07 UTC
I have not yet reported this upstream. But thank you for the suggestion to build with USE=debug; even without any extra configuration, once I build with USE=debug, the Xorg.0.log file (attached) gives some suggestive output; the relevant lines are (with timestamps removed) as follows:

(II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20170403
(II) intel(0): SNA compiled with assertions enabled
(II) intel(0): SNA compiled for use with valgrind
(WW) Falling back to old probe method for modesetting
(WW) Falling back to old probe method for fbdev
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/lib64/xorg/modules/libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
    compiled for 1.19.5, module version = 0.0.2
[420231.157]    ABI class: X.Org Video Driver, version 23.0
(EE) intel(0): [drm] failed to set drm interface version: Permission denied [13].
(II) intel(0): [drm] Contents of '/sys/kernel/debug/dri/0/clients':
(II) intel(0): [drm]              command   pid dev master a   uid      magic
(II) intel(0): [drm]                  fbi 27866   0   y    y  1000          0
(II) intel(0): [drm]                    X 27900   0   n    y     0          0
(EE) intel(0): Failed to claim DRM device.
(II) UnloadModule: "intel"
(EE) Screen(s) found, but none have a usable configuration.
(EE)
Fatal server error:
(EE) no screens found(EE)

So it looks to me like the problem is that fbi is grabbing the DRI "master" capability when its VT is activated, but not releasing it when I switch away.

I tried this with the latest non-live versions of xf86-video-intel and libdrm in the tree:
x11-libs/libdrm-2.4.88::gentoo was built with the following:
USE="-libkms -static-libs -valgrind" ABI_X86="32 (64) (-x32)" VIDEO_CARDS="intel -amdgpu (-exynos) (-fr
eedreno) -nouveau (-omap) -radeon (-tegra) (-vc4) (-vivante) -vmware"

x11-drivers/xf86-video-intel-2.99.917_p20171018::gentoo was built with the following:
USE="debug dri sna udev xvmc -dri3 -tools -uxa" ABI_X86="(64)"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,lazy"
Comment 5 Jonathan Lovelace 2017-11-10 07:32:53 UTC
Created attachment 503400 [details]
Xorg log when xf86-video-intel USE=debug
Comment 6 Matt Turner gentoo-dev 2018-11-27 22:51:04 UTC
Upstream driver bugs like this are really outside the capabilities of a distro
to fix.

Without an upstream bug.. there's nothing for me to do here.