ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
696 stars 59 forks source link

[BUG] Crash on start on Steam Deck #681

Closed carn1x closed 2 years ago

carn1x commented 2 years ago

Raze version

1.4.1

Which game are you running with Raze?

No response

What Operating System are you using?

Linux x86_64

Please describe your specific OS version

Linux steamdeck 5.13.0-valve10.3-1-neptune-02176-g5fe416c4acd8 #1 SMP PREEMPT Wed, 23 Feb 2022 20:55:35 +0000 x86_64 GNU/Linux

Relevant hardware info

Steam Deck 256Gb UK

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

Executing raze and nothing happens. raze-crash.log is created containing:

*** Fatal Error ***
Address not mapped to object (signal 11)
Address: 0x10

System: Linux steamdeck 5.13.0-valve10.3-1-neptune-02176-g5fe416c4acd8 #1 SMP PREEMPT Wed, 23 Feb 2022 20:55:35 +0000 x86_64 GNU/Linux

Executing: gdb --quiet --batch --command=gdb-respfile-AMPcrN
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
0x00007f991d9489ea in wait4 () from /usr/lib/libc.so.6

* Loaded Libraries
From                To                  Syms Read   Shared Object Library
0x00007f991e5f2050  0x00007f991e7010f2  Yes (*)     /usr/lib/libSDL2-2.0.so.0
0x00007f991e5c8790  0x00007f991e5cb8d0  Yes (*)     /usr/lib/librt.so.1
0x00007f991e5ae020  0x00007f991e5bb19c  Yes (*)     /usr/lib/libz.so.1
0x00007f991e5a6230  0x00007f991e5a7189  Yes (*)     /usr/lib/libdl.so.2
0x00007f991e15ba60  0x00007f991e365c2d  Yes (*)     /home/deck/Apps/Raze/libvpx.so.5
0x00007f991de42ed0  0x00007f991dee88e2  Yes (*)     /home/deck/Apps/Raze/libzmusiclite.so.1
0x00007f991dca6040  0x00007f991dda57a2  Yes         /usr/lib/libstdc++.so.6
0x00007f991dad83b0  0x00007f991db712f8  Yes (*)     /usr/lib/libm.so.6
0x00007f991da8f420  0x00007f991dabaea2  Yes         /usr/lib/libgomp.so.1
0x00007f991da6d020  0x00007f991da7e445  Yes         /usr/lib/libgcc_s.so.1
0x00007f991da50a50  0x00007f991da5e92f  Yes (*)     /usr/lib/libpthread.so.0
0x00007f991d8a3650  0x00007f991d9ec12d  Yes (*)     /usr/lib/libc.so.6
0x00007f991e796090  0x00007f991e7b90f6  Yes (*)     /lib64/ld-linux-x86-64.so.2
0x00007f991d7c0020  0x00007f991d843deb  Yes (*)     /usr/lib/libasound.so.2
0x00007f991d747020  0x00007f991d775203  Yes (*)     /usr/lib/libdbus-1.so.3
0x00007f991d673040  0x00007f991d6f6d20  Yes (*)     /usr/lib/libsystemd.so.0
0x00007f991d637020  0x00007f991d64e2d3  Yes (*)     /usr/lib/liblzma.so.5
0x00007f991d58a040  0x00007f991d621332  Yes (*)     /usr/lib/libzstd.so.1
0x00007f991d565020  0x00007f991d57fc97  Yes (*)     /usr/lib/liblz4.so.1
0x00007f991d559020  0x00007f991d55d7bb  Yes (*)     /usr/lib/libcap.so.2
0x00007f991d429040  0x00007f991d509f88  Yes (*)     /usr/lib/libgcrypt.so.20
0x00007f991d3f7040  0x00007f991d40cd22  Yes (*)     /usr/lib/libgpg-error.so.0
0x00007f991d3ca040  0x00007f991d3e42c0  Yes (*)     /usr/lib/libudev.so.1
(*): Shared library is missing debugging information.

* Threads
  Id   Target Id                               Frame 
* 1    Thread 0x7f991d78e800 (LWP 8786) "raze" 0x00007f991d9489ea in wait4 () from /usr/lib/libc.so.6

* FPU Status
  R7: Empty   0x00000000000000000000
  R6: Empty   0x00000000000000000000
  R5: Empty   0x00000000000000000000
  R4: Empty   0x00000000000000000000
  R3: Empty   0x00000000000000000000
  R2: Empty   0x00000000000000000000
  R1: Empty   0x00000000000000000000
=>R0: Empty   0x00000000000000000000

Status Word:         0x0000                                            
                       TOP: 0
Control Word:        0x037f   IM DM ZM OM UM PM
                       PC: Extended Precision (64-bits)
                       RC: Round to nearest
Tag Word:            0xffff
Instruction Pointer: 0x00:0x00000000
Operand Pointer:     0x00:0x00000000
Opcode:              0x0000

* Registers
rax            0xfffffffffffffe00  -512
rbx            0x2255              8789
rcx            0x7f991d9489ea      140295602997738
rdx            0x0                 0
rsi            0x5583c58a3c2c      94024443247660
rdi            0x2255              8789
rbp            0xb                 0xb
rsp            0x5583c58a3c18      0x5583c58a3c18
r8             0x0                 0
r9             0x7ffd64287c60      140726283828320
r10            0x0                 0
r11            0x246               582
r12            0x5583c58a3c2c      94024443247660
r13            0x1090              4240
r14            0x5583c58a1100      94024443236608
r15            0xb                 11
rip            0x7f991d9489ea      0x7f991d9489ea <wait4+26>
eflags         0x246               [ PF ZF IF ]
cs             0x33                51
ss             0x2b                43
ds             0x0                 0
es             0x0                 0
fs             0x0                 0
gs             0x0                 0

* Backtrace

Thread 1 (Thread 0x7f991d78e800 (LWP 8786) "raze"):
#0  0x00007f991d9489ea in wait4 () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x00005583c4c4ffac in ?? ()
No symbol table info available.
#2  <signal handler called>
No symbol table info available.
#3  0x00005583c4f4d5ee in FConfigFile::SetSection(char const*, bool) ()
No symbol table info available.
#4  0x00005583c4f995df in M_SaveJoystickConfig(IJoystickConfig*) ()
No symbol table info available.
#5  0x00005583c4c5490a in I_ShutdownInput() ()
No symbol table info available.
#6  0x00005583c4dfd2f4 in GameMain() ()
No symbol table info available.
#7  0x00005583c4c3a7c8 in main ()
No symbol table info available.

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Execute raze

Your configuration

Default

Provide a Log

No response

madame-rachelle commented 2 years ago

Where did you get your copy of Raze from? Did you compile it yourself?

carn1x commented 2 years ago

Where did you get your copy of Raze from? Did you compile it yourself?

Latest Linux build from https://github.com/coelckers/Raze/releases/download/1.4.1/Raze-Linux-1.4.1.zip unzipped and tried to run it. However I've since found that Raze works just fine through Steam Play / Proton, absolutely no issues. If this is an acceptable objective of the project then I'm happy to close this, since Steam Play on the Steam Deck is quite a common solution available to pretty much every Deck owner.

madame-rachelle commented 2 years ago

Having not the hardware myself, I would have to dedicate a machine to running SteamOS to diagnose this, unless it can be fixed on Arch, directly, which I doubt. I do not consider Proton the ideal solution, however I am happy that it at least works. So I think it best to leave this open, for now.

alexey-lysiuk commented 2 years ago

It seems, something fails to initialize as it crashes during shutdown. Please post content of ~/Raze/raze.log file.

dwhinham commented 2 years ago

I've been playing Raze on my Steam Deck, and it runs perfectly after some tinkering. I just used the binary release .zip as linked above. There may be a crash on exit which I haven't tried to debug yet, but for now here's some pointers on how I got it working:

Hope this helps. I'll try to debug the crash on my Deck if I get some time.

dwhinham commented 2 years ago

Ok, I've got a better understanding of what's happening now. There are a few things going on here that need some attention.

  1. The crash occurs because of a null pointer dereference that occurs only when there is a joystick present on the system, and Raze exits because it can't find any game data. I've created a PR to try to address that with #688. The crash can be reproduced on any Linux system with a joystick/pad connected; it's not unique to Steam Deck.

  2. Raze assumes that the kdialog tool must be present on the system if KDE is running (detected via the KDE_FULL_SESSION=true environment variable). However, SteamOS does not ship with kdialog, so error dialogs/game selection dialogs are not shown to the user (e.g. "Unable to find any game data") if the game is launched from the Steam Deck's Desktop Mode, which is KDE. I've submitted PR #689 to try to improve the kdialog detection, so that it can fall back on GTK dialogs if KDE is running, but kdialog is not present.

  3. For the current Linux release binary, if Raze is launched from Steam Deck's Game Mode, KDE_FULL_SESSION is not set, so Raze should fall back on GTK game selection/error dialogs. However, it seems like the current Linux binary was not compiled with GTK support, because it doesn't try to dynamically load the GTK libraries and show the dialog. Running strings raze | grep libgtk on the current release does not return any results, whereas my custom build with GTK support returns libgtk-3.so.0 and libgtk-x11-2.0.so.0; these are the strings the dynamic loading code uses to open the libraries: https://github.com/coelckers/Raze/blob/390cd2ca98d476952f01613a2afa866db1f6059d/source/common/platform/posix/unix/gtk_dialogs.cpp#L433

In summary, if the two PRs I've opened are merged, and the team releases a new binary with GTK support enabled, Raze should function properly in both of Steam Deck's modes without any workarounds and without having to install kdialog (which is inconvenient on SteamOS).

Cheers, -Dale

mjr4077au commented 2 years ago

Hi Dale (@dwhinham ),

Firstly, thank you for your excellent information and reconnaissance here, it's very much appreciated especially when none of us have a Steam Deck to do testing with.

PR #688 has been merged as I'm sure you're aware of, so thank you for that.

PR #689 I've requested a minor name change of your static function, but other than that it's good to go.

Regarding how the Linux binary is built, I believe @madame-rachelle kindly builds these for the project. I've never heard of GTK issues in the past so I'm wondering if something just went amiss for 1.4.1. Could you possibly try 1.3.0 or another release to see if they were built against GTK+? A new point release is scheduled soon so I'm sure this can be addressed.

I'm going to close this for now since it seems like once #689 is resolved and merged, everything will be sorted. Once again, our many thanks for your time and efforts.

Cheers, Mitch.

dwhinham commented 2 years ago

Hi Mitch! (@mjr4077au)

You are most welcome, I am more than happy to help. Raze and GZDoom are fantastic projects and are my favourite way to play Doom and Build engine games. They run buttery-smooth on the Steam Deck and the controls feel great!

Thank you for taking a look at my PRs! I can't see any review comments for #689 yet but am more than happy to make any amendments if you could highlight them over on the PR.

Re: Linux binaries - I was only able to find a Linux binary for 1.4.1 in the GitHub releases area; the older versions only seem to have binaries for Windows and macOS. If I'm looking in the wrong place, please let me know where to find the older builds and I'll test them out.

Thanks again for your reply, once again I'm glad to be of help.

Cheers! -Dale

mjr4077au commented 2 years ago

Haha I only tagged you to make sure you got a notification, it's not too often people sign off their messages with their actual name so I wanted to make sure I replied formally 😁

I properly fixed up that review on the PR, and you're not looking in the wrong place at all; it just appears I thought there were always Linux releases but 1.4.x must have been the first release where one was offered. I'm sure the next one we can have properly built against GTK+ to facilitate fallback as you've suggested though.

dwhinham commented 2 years ago

No problem at all, I was just making sure you got a ping too! :laughing:

I've taken care of tweaking the PR and hopefully it will be easy enough to resolve the GTK/build issue.

Thanks! :slightly_smiling_face:

zerocoregithub commented 1 year ago

I'm having the same/similar issues with Raze on an clean install of SteamOS on my Steam Deck. In the past I was able to run Duke3D and Blood by simply running Raze with Luxtorpeda as the compatibility layer. After reinstalling my deck in desktop mode the system just freezes for a minute when trying to run raze, then the process crashes crashes and the system becomes responsive again. In gaming mode the system freezes first, then the Steam Deck restarts.

I noticed the Luxtorpeda version of Raze dates back to 2019, so i also tried the latest stand-alone build, as well as all the workarounds mentioned by @dwhinham, such as moving some game data into the .config/raze folder, (re-)installing the mentioned dependencies and setting up the launch options. No dice.

Any idea what I could do?