Bug 1981118

Summary: [REGRESSION] Game crashes on i965 after update to Fedora 34
Product: [Fedora] Fedora Reporter: Konstantin <Hi-Angel>
Component: xorg-x11-server-XwaylandAssignee: Olivier Fourdan <ofourdan>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: mdaenzer, mediashark.pro, ofourdan, polinkuer12, pvrtz6ughn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-08 00:18:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Konstantin 2021-07-11 14:41:33 UTC
# Description of problem:

After upgrading Fedora 33→34 on Macbook 2013, game "Divinity Original Sin Enhanced Edition" always crashes on start with stacktrace:

    (0) /usr/lib/libpthread.so.0 : +0x13870 [0x7fd082419870]
    (1) ./libOGLBinding.so : api::OpenGLRenderer::ApplyConstants()+0x65 [0x7fd082d91845]
    (2) ./libRenderFramework.so : rf::Renderer::Apply(bool)+0x57 [0x7fd082a35437]
    (3) ./EoCApp : bik::BinkManager::Render()+0x260 [0xe91920]
    (4) ./EoCApp : ig::IggyBinding::IggyCustomDrawCallback(Iggy*, IggyCustomDrawCallbackRegion*)+0x382 [0xecf302]
    (5) ./EoCApp() [0x1235500]
    (6) ./EoCApp() [0x1237156]
    (7) ./EoCApp() [0x12357e9]
    (8) ./EoCApp() [0x1237156]
    (9) ./EoCApp() [0x12377f5]
    (10) ./EoCApp : IggyPlayerDrawTile+0x52 [0x1245382]
    (11) ./EoCApp : ig::FlashPlayer::Render(ls::ObjectHandle const&, ls::ObjectHandle const&)+0x1ad [0xed432d]
    (12) ./EoCApp : ig::IggyBinding::Render(rf::Renderer*, ls::IFlashPlayer*)+0xae [0xed045e]
    (13) ./libGameEngine.so : BaseApp::BeginDrawGUI(rf::Renderer*)+0xb0 [0x7fd082b91ea0]
    (14) ./libGameEngine.so : BaseApp::MakeFrame()+0x326 [0x7fd082b92456]
    (15) ./libGameEngine.so : BaseApp::OnIdle()+0xe0 [0x7fd082b90cb0]
    (16) ./EoCApp : main+0x170 [0x6d5180]
    (17) /usr/lib/libc.so.6 : __libc_start_main+0xd5 [0x7fd082261b25]
    (18) ./EoCApp : _start+0x29 [0x6d4ef9]

I have done a lot of research, and here's what I found:

* it is reproducible with i965 and with `LIBGL_ALWAYS_SOFTWARE=1`, but not with iris nor radeonsi.
* trying to bisect Fedora packages yielded:
  * last known working version 1.20.11 (latest available package on F33)
  * first known broken version 21.1.1 (earliest available package on F34)
* it is reproducible on Gnome and Sway

I tried building XWayland myself to bisect it further, but I can't seem to get it to work with Gnome (and with Sway older XWayland refuses to run the game with infinite loop of some odd errors about messagebox). I suppose Fedora might have carried some mandatory patches, so just trying to bisect upstream won't work here.

At this point I figured it might be more effective to report the bug, so here it is.

# Version-Release number of selected component (if applicable):

21.1.2-1

# Steps to Reproduce (in terms of terminal commands):

    $ cd ~/.steam/steam/steamapps/common/Divinity\ Original\ Sin\ Enhanced\ Edition/
    $ LIBGL_ALWAYS_SOFTWARE=1 ./runner.sh

## Actual results:

Black window appears, and a second later a messagebox with crash information pops up.

## Expected results:

Game window appears, and then main menu gets loaded.

Comment 1 Olivier Fourdan 2021-07-12 06:50:52 UTC
It's a client crash, unlikely to be Xwayland though.

Does the same work in Xorg?

Comment 2 Konstantin 2021-07-12 06:54:32 UTC
(In reply to Olivier Fourdan from comment #1)
> It's a client crash, unlikely to be Xwayland though.

Well, downgrading Xwayland fixes the problem. I now keep a backup of the older Xwayland binary just for the case we want to play Divinity.

> Does the same work in Xorg?

No crashes in Xorg, the problem is Wayland-specific.

Comment 3 Olivier Fourdan 2021-07-12 07:05:53 UTC
For the record, I found this report on Steam for a very similar crash… from 2015:

https://steamcommunity.com/app/373420/discussions/0/451848854987459089/?ctp=3

For the very same game.

Comment 4 Konstantin 2021-07-12 07:08:31 UTC
(In reply to Olivier Fourdan from comment #3)
> For the record, I found this report on Steam for a very similar crash… from
> 2015:
> 
> https://steamcommunity.com/app/373420/discussions/0/451848854987459089/?ctp=3
> 
> For the very same game.

This is another bug, it was reported and fixed in Mesa back then https://gitlab.freedesktop.org/mesa/mesa/-/issues/999 See how the last frame of the crash if `ChangeShader`. In the current report the last frame is `ApplyConstants`

Comment 5 Konstantin 2021-07-12 07:14:57 UTC
(In reply to Konstantin from comment #4)
> (In reply to Olivier Fourdan from comment #3)
> > For the record, I found this report on Steam for a very similar crash… from
> > 2015:
> > 
> > https://steamcommunity.com/app/373420/discussions/0/451848854987459089/?ctp=3
> > 
> > For the very same game.
> 
> This is another bug, it was reported and fixed in Mesa back then
> https://gitlab.freedesktop.org/mesa/mesa/-/issues/999 See how the last frame
> of the crash if `ChangeShader`. In the current report the last frame is
> `ApplyConstants`

Although, the Mesa commit is dated by 2019, hm. Then it's good I guess me with my gf started playing this game in 2020 after all of that was sorted out ☺

Comment 6 Olivier Fourdan 2021-07-12 07:20:07 UTC
One possibility is that Xwayland 21.1 exposes more configs or visuals than Xwayland 1.20.x and that might trigger a bug in the game (that is just a theory, you could compare the output of glxinfo between 1.20 and 21.1 to see what I mean), but FWIW, I am not convinced this really is a bug in Xwayland yet, that sounds more like either Mesa or the game itself.

Meanwhile I am installing that game on a laptop with NVIDIA to see how that goes.

Comment 7 Olivier Fourdan 2021-07-12 07:36:02 UTC
Oh… I have a question, comment 0 says works with hardware acceleration (iris or radeonsi) but fails with the software renderer, why do you want to use LIBGL_ALWAYS_SOFTWARE=1?

Comment 8 Konstantin 2021-07-12 07:37:51 UTC
(In reply to Olivier Fourdan from comment #7)
> Oh… I have a question, comment 0 says works with hardware acceleration (iris
> or radeonsi) but fails with the software renderer, why do you want to use
> LIBGL_ALWAYS_SOFTWARE=1?

It fails with i965 driver :-) The `LIBGL_ALWAYS_SOFTWARE=1` in steps to reproduce is only used because it makes it easy to reproduce the problem in absence of a i965-managed hardware.

Comment 9 Olivier Fourdan 2021-07-12 07:39:38 UTC
But the same works with the iris driver?

Comment 10 Konstantin 2021-07-12 07:43:37 UTC
(In reply to Olivier Fourdan from comment #9)
> But the same works with the iris driver?

Yep. The problem is on my gf's notebook with i965 driver. And I have another laptop, with iris and radeonsi drivers, and there I can only reproduce the crash with `LIBGL_ALWAYS_SOFTWARE=1`.

> One possibility is that Xwayland 21.1 exposes more configs or visuals than Xwayland 1.20.x and that might trigger a bug in the game (that is just a theory, you could compare the output of glxinfo between 1.20 and 21.1 to see what I mean)

Thanks for the hint! I'll compare the output once I'll be able to access the laptop with i965 (in 2 days).

Comment 11 Konstantin 2021-07-12 08:10:30 UTC
(In reply to Olivier Fourdan from comment #6)
> Meanwhile I am installing that game on a laptop with NVIDIA to see how that
> goes.

Thank you very much by the way for looking into this!

Comment 12 Olivier Fourdan 2021-07-12 08:37:59 UTC
As you mentioned, this is affecting only i965 and the SW renderer, it works with NVIDIA closed source driver, iris, and others.

To reproduce with i965, simple use:

    $ cd ~/.steam/steam/steamapps/common/Divinity\ Original\ Sin\ Enhanced\ Edition/
    $ MESA_LOADER_DRIVER_OVERRIDE=i965 ./runner.sh

Comment 13 Konstantin 2021-07-12 08:40:13 UTC
(In reply to Olivier Fourdan from comment #12)
> As you mentioned, this is affecting only i965 and the SW renderer, it works
> with NVIDIA closed source driver, iris, and others.
> 
> To reproduce with i965, simple use:

"*without i965" :) With i965 it's enough to just run the game, no env. variables needs to be set.
 
>     $ cd ~/.steam/steam/steamapps/common/Divinity\ Original\ Sin\ Enhanced\
> Edition/
>     $ MESA_LOADER_DRIVER_OVERRIDE=i965 ./runner.sh

Comment 14 Konstantin 2021-07-12 09:14:27 UTC
(In reply to Konstantin from comment #13)
> (In reply to Olivier Fourdan from comment #12)
> > As you mentioned, this is affecting only i965 and the SW renderer, it works
> > with NVIDIA closed source driver, iris, and others.
> > 
> > To reproduce with i965, simple use:
> 
> "*without i965" :) With i965 it's enough to just run the game, no env.
> variables needs to be set.
>  
> >     $ cd ~/.steam/steam/steamapps/common/Divinity\ Original\ Sin\ Enhanced\
> > Edition/
> >     $ MESA_LOADER_DRIVER_OVERRIDE=i965 ./runner.sh

Oh, nvm my comment, I misread your comment thinking you were referring to the `LIBGL_ALWAYS_SOFTWARE` variable

Comment 15 Michel Dänzer 2021-07-12 10:54:05 UTC
(In reply to Konstantin from comment #0)
> After upgrading Fedora 33→34 on Macbook 2013, game "Divinity Original Sin
> Enhanced Edition" always crashes on start with stacktrace:
> 
>     (0) /usr/lib/libpthread.so.0 : +0x13870 [0x7fd082419870]
>     (1) ./libOGLBinding.so : api::OpenGLRenderer::ApplyConstants()+0x65
> [0x7fd082d91845]

Since the crash occurs in game code, the immediate cause is most likely a game bug.


That said:

> I tried building XWayland myself to bisect it further, but I can't seem to
> get it to work with Gnome [...]. I suppose Fedora might have carried some
> mandatory patches, so just trying to bisect upstream won't work here.

I think it should be possible. What exactly was the problem with GNOME?

It would be interesting to know which Xwayland change triggered the crash.

One thing that comes to mind is that the newer Xwayland supports MSAA capable GLX visuals / FBConfigs.

Comment 16 Michel Dänzer 2021-07-12 10:57:18 UTC
> I think it should be possible. What exactly was the problem with GNOME?

Hmm, actually mutter in F34 probably uses some Xwayland command line parameters which the old Xwayland didn't support yet. You'd need to use mutter built against Xwayland 1.20.z as well.

Comment 17 Olivier Fourdan 2021-07-12 12:18:46 UTC
The issue seems to start with https://gitlab.freedesktop.org/xorg/xserver/-/commit/846924159

But the good news is that it works with https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/664

Comment 18 Olivier Fourdan 2021-07-12 12:33:16 UTC
I've spawned a scratch build for you to test if you will:

https://koji.fedoraproject.org/koji/taskinfo?taskID=71759435

Being a scratch build, it will be removed shortly, so please make sure to grab it while it's hot…

Comment 19 Konstantin 2021-07-12 13:01:38 UTC
(In reply to Olivier Fourdan from comment #18)
> I've spawned a scratch build for you to test if you will:
> 
> https://koji.fedoraproject.org/koji/taskinfo?taskID=71759435
> 
> Being a scratch build, it will be removed shortly, so please make sure to
> grab it while it's hot…

Oh, this is amazing, thank you very much for bisection and the package! I downloaded the package locally, will be able to test it 2 days once my gf is coming back (I tried to test it on my system as well, but apparently I can't just swap Archlinux XWayland binary with the one from Fedora and expect it to work, so gotta wait for a bit).

Comment 20 Konstantin 2021-07-14 19:59:36 UTC
(In reply to Olivier Fourdan from comment #18)
> I've spawned a scratch build for you to test if you will:
> 
> https://koji.fedoraproject.org/koji/taskinfo?taskID=71759435
> 
> Being a scratch build, it will be removed shortly, so please make sure to
> grab it while it's hot…

Amazing, thank you very much, I confirm it works!

FTR: I tested it by unpacking the package and copying its Xwayland binary over the system one. I couldn't install the package as is due to `rpm` complaining:

	file /usr/bin/Xwayland from install of xorg-x11-server-Xwayland-21.1.2-1.1test.fc34.x86_64 conflicts with file from package xorg-x11-server-Xwayland-21.1.2-1.fc34.x86_64

Comment 21 Olivier Fourdan 2021-07-15 06:36:27 UTC
(In reply to Konstantin from comment #20)
> FTR: I tested it by unpacking the package and copying its Xwayland binary
> over the system one. I couldn't install the package as is due to `rpm`
> complaining:

Just use:

$ rpm -Fvh xorg-x11-server-Xwayland-21.1.2-1.1test.fc34.x86_64.rpm

to upgrade the package (and not install the new one over the old one).

Comment 22 Ben Cotton 2022-05-12 16:20:16 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 23 Ben Cotton 2022-06-08 00:18:59 UTC
Fedora Linux 34 entered end-of-life (EOL) status on 2022-06-07.

Fedora Linux 34 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 24 ashleybrooks 2022-09-13 22:21:57 UTC Comment hidden (spam)
Comment 25 lolboost 2022-12-17 19:31:27 UTC Comment hidden (spam)
Comment 26 Zaaid El-Greiss 2023-11-02 19:17:03 UTC
<p>Hey there! It looks like you've done quite the detective work on this crash issue. It's a tricky one, especially since you've narrowed it down across different versions and environments—kudos for the thorough investigation!</p>

<p>From what you've gathered, it seems like the problem started occurring after an update to Fedora 34, and that's a pretty solid lead. I'm no expert on Fedora's package management, but it might be worth looking into any specific patches that Fedora includes with their XWayland package releases, as you suggested.</p>

<p>I remember running into something vaguely similar when I was grinding through the <a href="https://gamingcy.com/en-us/destiny-2-boost/trials-of-osiris" target="_blank" rel="noopener noreferrer">Trials of Osiris</a>. I needed to adjust some settings and ended up rolling back a few versions of a package to get a stable play session.</p>

<p>Have you tried reaching out on the Fedora forums or filing a bug report with the maintainers? Sometimes they might have patches in the works already or can offer a workaround. And, as you probably know, the more specific you can be about when it broke, the easier it'll be for them to track down the change that caused it.</p>

<p>For now, as a quick workaround, have you considered running the game through a different compatibility layer or a virtual machine set up with Fedora 33, just to get back in the game while the issue is sorted out? Not ideal, I know, but it could be a temporary band-aid.</p>

<p>Hope you get back to enjoying Divinity: Original Sin Enhanced Edition without any more crashes. That game's too good to be on the sidelines because of pesky bugs!</p>
This will display your comment as a paragraph of text on a webpage, with "Trials of Osiris" highlighted as a clickable link.

Comment 27 AxelGrom 2023-12-06 12:45:35 UTC
I encountered a similar problem in another version, it only helped when I waited for the update

Comment 28 Konstantin 2023-12-06 12:53:31 UTC
(In reply to AxelGrom from comment #27)
> I encountered a similar problem in another version, it only helped when I
> waited for the update

If you added this comment just in case another person would stumble upon this page from search engine, and wanted your comment to be useful to such person, then you mentioned too little. What version did you have and update to what version helped? What game was broken for you? What package did you update, was it XWayland? Because in the report it all came down to XWayland.

Comment 29 polinkuer12 2024-01-10 12:36:18 UTC
I also had the same problem and actually when I updated from the beginning it worked more stably for https://quikdraw.io

Comment 30 Charmaine9x 2024-03-19 03:27:18 UTC Comment hidden (spam)