Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Even the simplest SDL2 applications are not able to work with the iris DRI driver, if DRI2 and the intel DDX driver is in use instead of modesetting.
Version-Release number of selected component (if applicable):
EL up to version 8
Fedora up to version 33 (Rawhide)
Basically, everything up to xorg-x11-drv-intel-2.99.917-45.20200205.fc33 is affected.
https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071#note_374809227
Steps to reproduce:
1. Configure X.Org to use DRI2 and the intel DDX driver.
2. Reboot system.
3. Log-in in any desktop environment that uses X.Org (GNOME on X.Org, GNOME Classic, MATE, etc.).
4. Run Widelands from Flathub. When it comes to Fedora, you can use the native package instead. For EL, please use the flatpak package.
X.Org configuration:
```
# cat /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel"
#Driver "modesetting"
Driver "intel"
###
Option "TearFree" "True"
#Option "DRI" "3"
Option "DRI" "2"
EndSection
```
Widelands packages:
https://flathub.org/apps/details/org.widelands.Widelandshttps://github.com/scx/widelands-flatpakhttps://koji.fedoraproject.org/koji/packageinfo?packageID=4332https://copr.fedorainfracloud.org/coprs/scx/widelands
Expected results:
Run the application.
Actual results:
Crash the application.
Additional info:
https://github.com/widelands/widelands/issues/3937https://github.com/flatpak/flatpak/issues/3673https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1071https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188
dmesg log:
```
[ 399.377617] widelands[5462]: segfault at 24 ip 00007f7d795db1dc sp 00007ffe6c3f8d30 error 6 in libgallium_dri.so[7f7d78bd6000+cfd000]
```
gdb log:
```
$ flatpak run -d --command=sh org.widelands.Widelands
[📦 org.widelands.Widelands ~]$ gdb
GNU gdb (GDB) 8.3.1
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) file widelands
Reading symbols from widelands...
(No debugging symbols found in widelands)
(gdb) run
Starting program: /app/bin/widelands
warning: File "/usr/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/lib/x86_64-linux-gnu/libthread_db-1.0.so
line to your configuration file "/home/scx/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/scx/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
This is Widelands Version build-20 (Release)
Set home directory: /home/scx/.widelands
Adding directory: /app/share/widelands
selected language: (system language)
using locale en_US.UTF-8
[New LWP 9]
[New LWP 10]
[New LWP 11]
[New LWP 12]
Graphics: Try to set Videomode 800x600
Graphics: OpenGL: Version "4.6 (Compatibility Profile) Mesa 20.0.5"
Graphics: SDL_GL_RED_SIZE is 8
Graphics: SDL_GL_GREEN_SIZE is 8
Graphics: SDL_GL_BLUE_SIZE is 8
Graphics: SDL_GL_ALPHA_SIZE is 0
Graphics: SDL_GL_BUFFER_SIZE is 24
Graphics: SDL_GL_DOUBLEBUFFER is 1
Graphics: SDL_GL_DEPTH_SIZE is 24
Graphics: SDL_GL_STENCIL_SIZE is 8
Graphics: SDL_GL_ACCUM_RED_SIZE is 0
Graphics: SDL_GL_ACCUM_GREEN_SIZE is 0
Graphics: SDL_GL_ACCUM_BLUE_SIZE is 0
Graphics: SDL_GL_ACCUM_ALPHA_SIZE is 0
Graphics: SDL_GL_STEREO is 0
Graphics: SDL_GL_MULTISAMPLEBUFFERS is 0
Graphics: SDL_GL_MULTISAMPLESAMPLES is 0
Graphics: SDL_GL_ACCELERATED_VISUAL is 1
Graphics: SDL_GL_CONTEXT_MAJOR_VERSION is 2
Graphics: SDL_GL_CONTEXT_MINOR_VERSION is 1
Graphics: SDL_GL_CONTEXT_FLAGS is 0
Graphics: SDL_GL_CONTEXT_PROFILE_MASK is 2
Graphics: SDL_GL_SHARE_WITH_CURRENT_CONTEXT is 0
Graphics: SDL_GL_FRAMEBUFFER_SRGB_CAPABLE is 0
Graphics: OpenGL: Double buffering enabled
Graphics: OpenGL: Max texture size: 16384
Graphics: OpenGL: ShadingLanguage: "4.60"
Thread 1 "widelands" received signal SIGSEGV, Segmentation fault.
0x00007ffff3fb71dc in ?? ()
from /usr/lib/x86_64-linux-gnu/GL/default/lib/dri/iris_dri.so
(gdb) quit
A debugging session is active.
Inferior 1 [process 5] will be killed.
Quit anyway? (y or n) y
[📦 org.widelands.Widelands ~]$ exit
exit
```
The reason of using DRI2 and the intel DDX driver instead of modesetting:
https://github.com/flatpak/flatpak/issues/3673#issuecomment-650287489
In my opinion, it is the iris driver breaking ABI, but it seems that Intel is not interested into fixing it in Mesa. Instead, they provided fix in xf86-video-intel.
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811
Related issues:
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/issues/193https://gitlab.freedesktop.org/mesa/mesa/-/issues/2845https://gitlab.freedesktop.org/mesa/mesa/-/issues/2858https://gitlab.freedesktop.org/mesa/mesa/-/issues/3188
Currently, almost all Linux distributions are affected, including Fedora Rawhide and openSUSE Tumbleweed. When it comes to major Linux distributions, only Arch or Gentoo are not affected, because they tend to use the latest commit.
Although CentOS 7 doesn't provide the iris driver, it is affected as well, because Freedesktop 19.08 uses Mesa 20.x, in which iris is the default driver. This means that all current flatpak packages from Flathub are affected.
The solution is to patch xf86-video-intel in all current Linux distributions.
I've created the xorg-x11-drv-intel repo for EL 6-8 and Fedora 30-33:
https://copr.fedorainfracloud.org/coprs/scx/xorg-x11-drv-intel/
I've already tested it in RHEL 7 and Fedora 32. I can confirm it works.
SRC RPM:
https://copr-be.cloud.fedoraproject.org/results/scx/xorg-x11-drv-intel/epel-7-x86_64/01523758-xorg-x11-drv-intel/xorg-x11-drv-intel-2.99.917-29.20180530.el7.src.rpm
Full RPM SPEC:
https://copr-be.cloud.fedoraproject.org/results/scx/xorg-x11-drv-intel/epel-7-x86_64/01523758-xorg-x11-drv-intel/xorg-x11-drv-intel.spec
Patch ("0002-dri2-Interpret-DRI2ATTACH_FORMAT-as-depth-not-bpp.patch"):
https://gitlab.freedesktop.org/xorg/driver/xf86-video-intel/-/commit/f2a54e256dd7539633c476a379db2b1e60eec811.patch
Created attachment 1700230[details]
Upstream patch for xf86-video-intel (xorg-x11-drv-intel)
In mesa i915/i965 pass the bpp to use when creating the surface, but the gallium state tracker passed the depth. As it happens that BitsPerPixel(format) will do the right thing for both, use that.