sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.13k stars 71 forks source link

Custom Command EXE not launching #1176

Open Jonathing opened 5 hours ago

Jonathing commented 5 hours ago

System Information

Issue Description

I play Spelunky using mods by launching playlunky_launcher.exe from Playlunky. I have historically done this by setting the custom command to use this exe file and setting it to only use this custom command, since this is not just an injector but also a launcher for Spelunky 2 itself.

However I have not been able to do this as of late. The main reason I'm reporting this here is because I am unable to generate or get any logs of any process. SteamTinkerLaunch simply declares that the process died after 3 seconds and gives me its usual crashed game prompt. No proton logs, no gamelaunch logs, nothing. This has made it very difficult to debug this problem. I've tried this with both GE-Proton9-15 and Proton 9.0-3c, neither of which have given me any success. Note that launching the game normally without the use of the custom command does not have this issue.

Also, I found that when going into One-time Run, opening Winetricks, and manually opening the .exe file from a CMD command prompt, it actually works properly (aside from the fact that it isn't running in the actual steam runtime environment I want it to). I understand if this is more of a support inquiry than an actual bug report, but I really don't know where else to ask and I'm out of ideas for how to debug this. I hope you understand.

Logs

I was somehow lucky enough to have gotten a single Proton log file. It's full of a bunch of stuff I cannot read, but it's better than nothing.

I've attached the log, my spelunky 2 STL config, and my global game vars to this gist: https://gist.github.com/Jonathing/4cb9962ae8da13fcb64067abefae9cfe

sonic2kk commented 5 hours ago

I'll check when I'm on my PC and have some time but this sounds strange. I have been using custom commands to play games like Touhou with patches and haven't had any trouble, though I haven't tried in possibly around a week or so.

When using One-Time Run, are you using the same Proton version as with a custom command? In case there is a discrepancy here. This does read like a Proton compatibility problem, since it worked before and stopped out of nowhere, but since it works with One-Time Run that is very strange. I'll have to investigate a bit.

Out of interest, do custom commands work with other games? Similarly, does the Steam Linux Runtime option have any effect on this game? And finally, just to confirm on my side, the SteamTinkerLaunch version didn't change?

Note that you can use the Steam Linux Runtime with One-Time Run, but this isn't the intended use-case for that (One-Time Run is really intended for things like running mod patches as a once-off or other configuration that should be ran before running an application).

sonic2kk commented 5 hours ago

From a quick glance on my phone, maybe the extProtonRun start command is mangled. I haven't compared to see if the command log on my machines looks like this or not.


Sun Sep 29 13:24:43 EDT 2024 INFO - extProtonRun - "/home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /usr/bin/gamemoderun /usr/bin/gamemoderun /usr/bin/gamemoderun /usr/bin/gamemoderun /usr/bin/gamemoderun /usr/bin/gamemoderun" "/home/jonathing/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "/home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe"

All of the repeated Steam Linux Runtime paths looks very unusual and potentially problematic.

Could just be weird log formatting. However, /home/jonathing/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "/home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe" looks very unusual to me. This should just be the game EXE. Maybe Proton is using a different start command now? That seems unlikely though. If I'm remembering properly this is supposed to be filtered out by this point.

I'll check more when I'm able to, just something I noticed.

As for the Proton launch log attached, it seems like a crash, and a bad launch command could potentially explain that (and the bad launch command would explain why no logs are coming back).

Jonathing commented 5 hours ago

Unfortunately I have not been able to test the custom command with any other games. Spelunky is the only game I mod that uses a launcher the way it does. Every other game I mod uses r2modman or some sort of traditional DLL injection that I can easily use with WINEDLLOVERRIDES.

After I eat lunch I'll checkout an older commit of SteamTinkerLaunch (around the last time I remember it working) to see if it's a problem with a newer commit, but I don't think it is at the moment.

Could just be weird log formatting. However, /home/jonathing/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "/home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe" looks very unusual to me. This should just be the game EXE. Maybe Proton is using a different start command now? That seems unlikely though. If I'm remembering properly this is supposed to be filtered out by this point.

So is it supposed to just be /home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe? You might find something in my game config. I am trying to pass in external programs as well (such as GameMode) into the custom command as well.

Lunch time brb

sonic2kk commented 4 hours ago

I think the command is supposed to use waitforexitandrun but I'll have to double check the code.

The wider launch command is likely supposed to be something like this, which is much shorter:

/home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- "/usr/bin/gamemoderun" "/home/jonathing/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "/home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe"

I wonder if something is getting duplicated when trying to pass custom programs like GameMode. I'm not sure why he Steam Linux Runtime path is being duplicated so much. I don't think it's an issue on your end, there might be a bad code path somewhere. But even your custom commands are being duplicated in the launch command. It's very strange, I haven't seen anything mangled like this before, I'll have to try and dig into why.

Jonathing commented 4 hours ago

Debugging freaky shit like this is a staple feature of the Linux desktop 🫡🔥

Jonathing commented 3 hours ago

hey chat i'm back

The first thing I did was run the game with the settings I sent earlier (so I did not change anything) and then immediately exit SteamTinkerLaunch when it failed. So here's a steamtinkerlaunch log with only the waiter, launch sequence and crash menu.

https://gist.github.com/Jonathing/86541e4cdb7d562ff1da3e6aff8fe032

The plot thickens, because now the entry point log looks like this

Sun Sep 29 15:28:20 EDT 2024 INFO - extProtonRun - "/home/jonathing/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point --verb=waitforexitandrun -- /usr/bin/gamemoderun" "/home/jonathing/.local/share/Steam/steamapps/common/Proton 9.0 (Beta)/proton" run "/home/jonathing/.local/share/Steam/steamapps/common/Spelunky 2/playlunky_launcher.exe"

yet the game is still crashing. Still on latest commit.

Jonathing commented 1 hour ago

Big update. I got the game working again. I also found out why the older logs have mangled launch arguments in them.

So, it looks like Playlunky's launcher does not play well at all with Steam Linux Runtime. The moment I disabled using Steam Linux Runtime for the custom command, it no longer immediately crashed. As for why that is, I don't know, but the game is working again so I don't think it really warrants investigation. It is not part of the game, after all.

Root Cause

What made this issue incredibly difficult to debug was that, in between launches, SteamTinkerLaunch would keep all launch arguments, including programs, if it was not exited from the crash menu. If you click on "Retry Different Settings", it will not do any sort of cleanup or sanitation of the previous launch parameters. It's possible that this might be exclusive to custom commands only, as I have never had this problem from launching the games themselves. So, if I were to never exit STL after the first few launches, then toggle the SLR switch for the custom command, it would eventually prepend the SLR program to the launch call twice or maybe even three times.

I also checked out commit version v14.0.20240624-1 (144347b) and the issue happened there as well, so it doesn't seem to be the result of any recent bad code.

It might be worth putting a warning for the option to enable SLR for custom commands since they don't seem to play well. I had it enabled because I assumed that it would be necessary for the game to function at all, which isn't necessarily the case.

In any case, I've found a solution to what I originally opened this issue for, so I will be closing it. If you want to open a separate issue to track the above behavior I mentioned, that's up to you. Thanks for your comments earlier, they helped me try and point in the right direction.