Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
893 stars 162 forks source link

LeagueClient hangs on GNU Guix's wine@7.8 and wine-stagin@7.8 with tkg-leagueoflolfix patch #811

Open Kreyren opened 2 years ago

Kreyren commented 2 years ago

The RiotClient works and it shows the League of Legends logo in the middle of the screen, but won't launch the game, is it supposed to work on this version of wine?

Steps to reproduce

  1. Get GNU Guix 0.1. On Parabola GNU/Linux and it's alternatives it can be installed using following command:

    • # pacman -Syu guix # To install guix
    • $ guix pull # To pull guix repositories
    • # pacman -Rns guix # To cleanly uninstall guix
  2. # echo 0 > /proc/sys/abi/vsyscall32 # To disabled the vdso32

  3. Apply the tkg-leagueoflolfix patch and launch the game:

    $ guix shell wine \
    --with-patch=wine=path/to/leagueoflolfix.patch
    -- wine path/to/LeagueClient.exe # To launch the game
  4. Expect issue described above

Additional Informations

The path to zipped built source code with the applied patch can be obtained using guix build wine -S --with-patch=wine=path/to/leagueoflolfix.patch


CC @Tk-Glitch

Tk-Glitch commented 2 years ago

For the game to run, in addition to the wine patch and disabling vdso32 you'd also need to do run something like this:

#!/bin/bash

process=LeagueClientUx.exe
uxpid=$(timeout 4m sh -c "until pidof ${process}; do sleep 1; done")
if [[ ! -n $uxpid ]]; then
  echo "Could not find process ${process}"
  exit 1
fi
echo "LeagueClientUx pid: ${uxpid}"
port=$(xargs -0 < /proc/${uxpid}/cmdline \
  | sed -n 's/.*--app-port=\([[:digit:]]*\).*/\1/p')
if [[ ! -n $port ]]; then
  echo "Could not find port"
  exit 1
fi
echo "Waiting for port ${port}"

kill -STOP ${uxpid}
timeout 5m /bin/bash -c "
until openssl s_client -ssl3 -connect :${port} <<< Q > /dev/null 2>&1; do
  sleep 1
done"
kill -CONT ${uxpid}

Which will allow things to go past the splash (yet it can take a while).

Apparently lutris stopped shipping it in favor of an additional wine patch I'm not a fan of.. I have added the relevant patch with https://github.com/Frogging-Family/wine-tkg-git/commit/2f1407d00d06f4cfe98c41a0fc545f7f1c591162 so the script isn't needed anymore.

Kreyren commented 2 years ago

@Tk-Glitch Thanks for the patch! appreciated!

Using only the patch makes the launcher to work (aldo very slow to launch and respond to user-input), but then gets stuck on tutorial seemingly unable to launch the game. 2022-07-23_17-53

and applying that on wine-staging causes it to throw wine: Unhandled exception 0x80000003 in thread 300 at address 126FE566 (thread 0300), starting debugger... for RiotClientServices.exe and launching it through LeagueClient.exe crashes after ~8 min with The futex facility returned an unexpected error code.

Tk-Glitch commented 2 years ago

but then gets stuck on tutorial seemingly unable to launch the game

With vdso32 disabled? That's usually what happens when it's not disabled. Make sure to run echo 0 > /proc/sys/abi/vsyscall32 as su, or run sudo sysctl -w abi.vsyscall32=0.

The futex facility returned an unexpected error code

Looks like a possible fsync issue. If that's enabled, try with either esync or plain server sync and see if it's any better.

Kreyren commented 2 years ago
$ cat /proc/sys/abi/vsyscall32 
0

yes, with vsyscall32 disabled

Looks like a possible fsync issue. If that's enabled, try with either esync or plain server sync and see if it's any better.

This should be a vanilla wine + your lol patch so i don't think it has fsync or esync capability.

On staging parsed WINEESYNC=1 which reports in output esync: up and running. results in following if i launch the game from the RiotGamesServices.exe:

esync: write: Bad file descriptor
eventfd: Too many open files
eventfd: Too many open files
...
eventfd: Too many open files
wine: Call from 7B044155 to unimplemented function msvcp140.dll.?_Throw_Cpp_error@std@@YAXH@Z, aborting
eventfd: Too many open files
eventfd: Too many open files
The futex facility returned an unexpected error code.

From LeagueClient.exe it doesn't do anything for ~8min, then shows the logo in the middle of the screen and closes with The futex facility returned an unexpected error code.

Using Fsync through setting WINEFSYNC=1 with WINEFSYNC_SPINCOUNT not set also results in $ The futex facility returned an unexpected error code. after ~8 min.

Tk-Glitch commented 2 years ago

This should be a vanilla wine + your lol patch so i don't think it has fsync or esync capability.

Ok, then there's something bad happening on the kernel side.

eventfd: Too many open files

This is usually caused by low limits. See https://github.com/lutris/docs/blob/master/HowToEsync.md#how-to-make-your-system-esync-compatible

wine: Call from 7B044155 to unimplemented function msvcp140.dll.?_Throw_Cpp_error@std@@YAXH@Z

Weird one, but I guess it's linked to the broken esync.

I suppose I'll have to test it out myself as it used to "work" albeit slowly.

Tk-Glitch commented 2 years ago

I cannot reproduce the issue on a fresh build (7.13 + staging + fsync), of course made using the wine-tkg-git build system. The game works well with both esync and fsync also. Peek 23-07-2022 20-19.webm

Kreyren commented 2 years ago

This is usually caused by low limits. See https://github.com/lutris/docs/blob/master/HowToEsync.md#how-to-make-your-system-esync-compatible -- @Tk-Glitch

$ ulimit
unlimited
$ ulimit -Hn
4096

According to https://guix.gnu.org/en/manual/devel/en/html_node/Base-Services.html I set the following in my <operating-system> configuration and rebuilt the system:

;; NOTE(Krey): Raise the hard limits for file descriptors to use wine ESYNC e.g. for League of Legends (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issuecomment-1193162857)
(add-to-transducer! os (services
            (append
             (operating-system-user-services os)
             (list
              (pam-limits-service
               (list
                (pam-limits-entry "*" 'both 'nofile 524288)))))))
$ ulimit
unlimited
$ ulimit -Hn
524288

Using esync:

Using fsync:

starts with the logo in the middle and opens the client, then same issue with infinite loading

Tk-Glitch commented 2 years ago

The update failure is a known wine issue. We have a hotfix for it here : https://github.com/Frogging-Family/wine-tkg-git/tree/master/wine-tkg-git/wine-tkg-patches/hotfixes/GetMappedFileName

Tk-Glitch commented 2 years ago

Not sure if it'll work when already in the broken state, but nothing a new prefix can't resolve.

Kreyren commented 2 years ago

Not sure if it'll work when already in the broken state, but nothing a new prefix can't resolve. -- @Tk-Glitch (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issuecomment-1193171822)

Tried new wineprefix and full game reinstall, but still having the The futex facility returned an unexpected error code. issue on FSYNC, on ESYNC it seems to launch the LeagueClient fine, but still won't launch the game from the launcher

The update failure is a known wine issue. We have a hotfix for it here : https://github.com/Frogging-Family/wine-tkg-git/tree/master/wine-tkg-git/wine-tkg-patches/hotfixes/GetMappedFileName -- @Tk-Glitch (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issuecomment-1193171679)

Noted, i will apply it next time i have the issue


The wine-tkg-git build system seems to be applying some legacy patches on

https://github.com/Frogging-Family/wine-tkg-git/blob/master/wine-tkg-git/PKGBUILD#L299

Maybe that's what is altering the result?

Tk-Glitch commented 2 years ago

There is more than that to it. The part you linked leads to dynamic patching. There may or may not be any patch behind that.. But there are more patches outside :frog: There's a reason for the build system to exist, this repo isn't a patchlist.

There's a new addition to the lol patch btw : https://github.com/Frogging-Family/wine-tkg-git/commit/c4dd8bc9e84214b1ca58c8f491f7a2cc2f8c7af0

And a lol build was added to CI : https://github.com/Frogging-Family/wine-tkg-git/actions/workflows/wine-lol.yml

Kreyren commented 2 years ago

There is more than that to it. The part you linked leads to dynamic patching. There may or may not be any patch behind that.. But there are more patches outside frog There's a reason for the build system to exist, this repo isn't a patchlist. -- @Tk-Glitch (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issuecomment-1196536892)

To clarify my end-goal is to make this working on GNU Guix so i was asking:

The RiotClient works and it shows the League of Legends logo in the middle of the screen, but won't launch the game, is it supposed to work on this version of wine? -- @Kreyren (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issue-1315629672)

Meaning if i can just grab the leagueoflol patch and expect it to work OR if i have to define a new GNU Guix package to use your build or grab more patches, because grabbing lutris or pre-built binaries is not an option due to how guix works..


There's a new addition to the lol patch btw : c4dd8bc -- @Tk-Glitch (https://github.com/Frogging-Family/wine-tkg-git/issues/811#issuecomment-1196536892)

ehh so can i just use it as a patchlist (if so can you give me a list of patches and wine commit to use? :point_right: :point_left:) to grab or is this designed to only work with the build system that i need to port into a package definition? O_o