FS#78628 - [dolphin-emu] version 1:5.0.r19368.dadbeb4bae-1 crashes immediately on starting any game

Attached to Project: Community Packages
Opened by Mike Swanson (chungy) - Saturday, 27 May 2023, 15:55 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 30 September 2023, 17:51 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 14
Private No

Details

Description: After updating my system and receiving 1:5.0.r19368.dadbeb4bae-1 as part of it, I am no longer able to play any game on Dolphin, instead the program segfaults (and no debugging symbols are available: the gdb backtrace is all ?? entries).

Downgrading dolphin-emu to 1:5.0.r18498.46b99671d9-2 (and mbedtls to 2.28.2-1) works for making the program run as expected (games work).


Additional info:
* dolphin-emu 1:5.0.r19368.dadbeb4bae-1

Steps to reproduce:
1. Launch Dolphin
2. Try to play any game (The Wii System Menu option will also trigger it)
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 30 September 2023, 17:51 GMT
Reason for closing:  Fixed
Comment by Toolybird (Toolybird) - Sunday, 28 May 2023, 00:29 GMT
> no debugging symbols are available: the gdb backtrace is all ?? entries

That means you didn't enable debug symbols download [1]. It's usually as simple as:

$ coredumpctl gdb (then answer y when it asks "Enable debuginfod for this session?")
(gdb) set logging enabled
(gdb) bt (or bt full)

Then post gdb.txt

I tried to repro in a fresh VM but I don't have any ROMs. But having said that, it does crash on exit anyway, but who knows if it's the same crash. Traces attached.

[1] https://wiki.archlinux.org/title/Debugging/Getting_traces
Comment by Mike Swanson (chungy) - Sunday, 28 May 2023, 04:11 GMT
> That means you didn't enable debug symbols download

gdb was able to download symbols for just about everything else. It told me dolphin-emu's symbols aren't available. (For some reason, I can't recompile the package either to get a local version :/)

> I tried to repro in a fresh VM but I don't have any ROMs.

If you use "Tools → Perform System Update", you can get the System Menu files from Nintendo's servers.
Comment by Toolybird (Toolybird) - Sunday, 28 May 2023, 07:35 GMT
> It told me dolphin-emu's symbols aren't available

You're right. The debug pkg simply doesn't exist on the server. I don't know why this is the case. Inside the .BUILDINFO I see:

options = debug

which means it should be there. Something must be wrong in the workflow somewhere. Hopefully our PM knows what's going on?

> If you use "Tools → Perform System Update"

Ah, thanks for the tip. I can now repro. But we need those debug symbols...
Comment by Maxime Gauduin (Alucryd) - Sunday, 28 May 2023, 10:43 GMT
Just pushed the debug package, it's quite a large beast :)
Comment by illogician (illogician) - Sunday, 28 May 2023, 20:58 GMT
Version 1:5.0.r19433.34527cadcc-2 is still broken. Instead of crashing when a render window opens, it's now freezing.

Experimenting with the PKGBUILD locally, building in a clean chroot with the `extra-x86_64-build` archbuild script resulted in a package that behaves identically to the package from the repos, i.e. segfaults on render window creation for 1:5.0.r19368.dadbeb4bae-1, and freezes for 1:5.0.r19433.34527cadcc-2.

However, building the PKGBUILD in a "classic" clean chroot as outlined here (https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot#Classic_way) resulted in a package that worked normally.

The broken package from the `extra-x86_64-build` script is 9.4MiB, and the working package from the traditional chroot is 21.7MiB. Extracting the package and examining the binaries directly, the broken binaries are a combined 30.3MiB, while the working ones are a combined 52.9MiB. All other files within the packages are the same size.

Is the `extra-x86_64-build` script stripping something vital out of the binaries in the runup to compression? Is that script used by the Arch build servers?
Comment by Toolybird (Toolybird) - Sunday, 28 May 2023, 23:42 GMT
> Instead of crashing when a render window opens, it's now freezing

Not for me, it still crashes...just takes longer for systemd-coredump to process it.

> However, building the PKGBUILD in a "classic" clean chroot<...>

That makes no sense whatsoever. extra-x86_64-build is just a wrapper around the classic method. They should be identical (unless something funky is going on in your setup, or it's just buggy).

Anyway, here's the latest backtrace. (I gave up on trying to get more as my VM's just don't have enough mem.)
Comment by illogician (illogician) - Monday, 29 May 2023, 05:35 GMT
>That makes no sense whatsoever. extra-x86_64-build is just a wrapper around the classic method. They should be identical

Yeah, it's odd. It's possible it's something on my end, but the results are the same across multiple attempts: Build with extra-x86_64-build, package behaves like the repo package. Build with the "classic" method, package works just fine.

I doubt it'll be much help, but here's the build logs for both if anyone wants to give them a look
Comment by Toolybird (Toolybird) - Monday, 29 May 2023, 05:57 GMT
> Yeah, it's odd

Actually, it's a devtools bug. devtools went through a reorg for the git migration...and now the classic method gives you a different makepkg.conf than if using extra-x86_64-build. There was also this bug [1] now fixed in [extra-testing]. It might even all be the same issue. Will investigate...

Anyway, back on topic. It could be different *FLAGS causing the different working/broken builds (or debug, or LTO, or...)

[1] https://gitlab.archlinux.org/archlinux/devtools/-/issues/149
Comment by loqs (loqs) - Monday, 29 May 2023, 19:33 GMT
> Anyway, back on topic. It could be different *FLAGS causing the different working/broken builds (or debug, or LTO, or...)
Disabling LTO stops the coredump on exit for me.
Comment by Toolybird (Toolybird) - Monday, 29 May 2023, 22:58 GMT
> Build with the "classic" method, package works just fine.

Ok, to clarify my rambling above :) The classic method is currently not ideal. As hinted at in the wiki, you have to provide a custom pacman.conf and makepkg.conf in order to achieve the same outcome as extra-x86_64-build. And because of the aforementioned devtools bug, this currently doesn't work (unless you use devtools-1:1.0.2-1 from [extra-testing]).

> Disabling LTO stops the coredump on exit for me.

Thanks @loqs. Your results match those of @illogician (due to the devtools situation outlined above).

Comment by loqs (loqs) - Tuesday, 30 May 2023, 04:55 GMT
Leaving LTO enabled and switching to clang also stopped the coredump on exit for me. See attached diff. Toolchain issue or perhaps just made it harder to reproduce.
Comment by Maxime Gauduin (Alucryd) - Tuesday, 30 May 2023, 15:04 GMT
Does `-ffat-lto-objects` help with gcc?
Comment by loqs (loqs) - Tuesday, 30 May 2023, 15:56 GMT
> Does `-ffat-lto-objects` help with gcc?
No. tested both with and without thin archive creation disabled in CMakeLists.txt. Are you unable to reproduce the issue locally?
Comment by Toolybird (Toolybird) - Monday, 19 June 2023, 03:10 GMT
Dupe  FS#78819 

Please review above dupe because it contains an interesting workaround i.e. build with gcc-12
Comment by Toolybird (Toolybird) - Thursday, 29 June 2023, 22:41 GMT
More dupes  FS#78926   FS#78985 
Comment by David Marrero (badlydrawnface) - Wednesday, 23 August 2023, 19:27 GMT
Still nothing, fails to load video backend.

version 5.0-19870
Comment by Jane (Jumpingmanjim) - Saturday, 02 September 2023, 07:30 GMT
the dolphin-emu-git version from aur seems to work all of a sudden, not sure what is going on.
Comment by loqs (loqs) - Saturday, 02 September 2023, 10:19 GMT
@Jumpingmanjim with LTO enabled or disabled?
Comment by Jane (Jumpingmanjim) - Saturday, 02 September 2023, 10:26 GMT
I just downloaded it with yay. How can I check if LTO is enabled or not?
Comment by loqs (loqs) - Saturday, 02 September 2023, 11:46 GMT
dolphin-emu-git disables LTO [1] so unless you overrode that it is built with LTO disabled which would explain why it does not have the issue.

[1] https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=dolphin-emu-git&id=3a143a0c48aa0732ed71b46a67afb4ba63447e6d#n27
Comment by Jane (Jumpingmanjim) - Saturday, 02 September 2023, 12:19 GMT
how important is lto for performance anyway?
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 29 September 2023, 18:28 GMT
I fixed this, I believe. It was -O2. Please check rel-2.
Comment by loqs (loqs) - Friday, 29 September 2023, 19:32 GMT
dolphin-emu-1:5.0.r19870.032c77b462-2 for me still produces Segmentation fault (core dumped)
Reinstating O2 and disabling LTO and I can no longer reproduce the issue.
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 29 September 2023, 23:56 GMT
That's odd, it definitely fixes a crash for me. Will check lto.
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 30 September 2023, 17:51 GMT
I confirmed disabling lto also fixes it. This is probably preferable.

Loading...