#291 The code to check for blocked hosts in the launcher never finishes

Closed
opened 2 years ago by FichteFoll · 9 comments

With the latest launcher code, I just get shown a terminal four times that doesn't close by itself until I ctrl-c it, after which the game eventually starts. I can observe in htop that the find processes are called and just don't appear to terminate by themselves.

I'm using Arch Linux, wine-staging (7.5) and Lutris.

With the latest launcher code, I just get shown a terminal four times that doesn't close by itself until I ctrl-c it, after which the game eventually starts. I can observe in htop that the `find` processes are called and just don't appear to terminate by themselves. I'm using Arch Linux, wine-staging (7.5) and Lutris.
thojohns commented 2 years ago

I've been having a similar issue dating back to the start of this patch with Arch, Lutris and a custom wine build based on 7.5, but haven't taken the time to debug it further. I manually verified that the domains were being blocked correctly, commented out that whole section of the batch file, and moved on.

I would assume it's some sort of regression in newer wine builds, but I can't really confirm that; it wasn't happening beforehand, and I updated my wine from a 7.3-based build during the downtime between patches.

I've been having a similar issue dating back to the start of this patch with Arch, Lutris and a custom wine build based on 7.5, but haven't taken the time to debug it further. I manually verified that the domains were being blocked correctly, commented out that whole section of the batch file, and moved on. I would assume it's some sort of regression in newer wine builds, but I can't really confirm that; it wasn't happening beforehand, and I updated my wine from a 7.3-based build during the downtime between patches.
Krock commented 2 years ago
Owner

Which script are you exactly talking about? Is it the following line? https://notabug.org/Krock/dawn/src/master/260/patch_files/launcher.bat#L15

If so, please execute the commands manually in a Wine cmd.exe process. Many cmd functionalities can be checked using test_builtins.cmd. It might be possible that a recent Wine commit either broke a certain syntax or fixed previously broken code (which would imply bad launcher.bat contents).

Do older versions work properly? I tested Wine 7.2 successfully, so it might be a new issue.

Which script are you exactly talking about? Is it the following line? https://notabug.org/Krock/dawn/src/master/260/patch_files/launcher.bat#L15 If so, please execute the commands manually in a Wine `cmd.exe` process. Many cmd functionalities can be checked using [test_builtins.cmd](https://github.com/wine-mirror/wine/blob/master/programs/cmd/tests/test_builtins.cmd). It might be possible that a recent Wine commit either broke a certain syntax or fixed previously broken code (which would imply bad `launcher.bat` contents). Do older versions work properly? I tested Wine 7.2 successfully, so it might be a new issue.
FichteFoll commented 2 years ago
Poster

Yes, the four lines with find in them. After commenting the whole block and adjusting the variables, I am able to start Genshin as before.

Here are the ping commands:

C:\>ping -n 1 -w 1 log-upload-os.mihoyo.com
Pinging log-upload-os.mihoyo.com [0.0.0.0] with 32 bytes of data:
PING: transmit failed. General failure.

Ping statistics for 0.0.0.0
        Packets: Sent = 1, Received = 0, Lost = 1 (100% loss)

C:\>ping -n 1 -w 1 overseauspider.yuanshen.com
Pinging overseauspider.yuanshen.com [0.0.0.0] with 32 bytes of data:
PING: transmit failed. General failure.

Ping statistics for 0.0.0.0
        Packets: Sent = 1, Received = 0, Lost = 1 (100% loss)

C:\>ping -n 1 -w 1 log-upload-os.mihoyo.com | find "[0.0.0.0]"
Pinging log-upload-os.mihoyo.com [0.0.0.0] with 32 bytes of data:

C:\>FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (echo %%i | find "[0.0.0.0]" >nul )

C:\>FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (echo %%i | find "[0.0.0.0]"; IF !ERRORLEVEL! EQU 0 echo ERR )

All of these terminated instantly. Regardless, if I start the launcher, this happens (attached, in htop) and then nothing until I ctrl-c the empty console.

I also attached the output of test_builtins.cmd > test_builtins.log 2>&1.

Edit: apparently you cannot append text files, so here it is on a temporary online storage: https://x0.at/gStk.txt

Yes, the four lines with `find` in them. After commenting the whole block and adjusting the variables, I am able to start Genshin as before. Here are the ping commands: ``` C:\>ping -n 1 -w 1 log-upload-os.mihoyo.com Pinging log-upload-os.mihoyo.com [0.0.0.0] with 32 bytes of data: PING: transmit failed. General failure. Ping statistics for 0.0.0.0 Packets: Sent = 1, Received = 0, Lost = 1 (100% loss) C:\>ping -n 1 -w 1 overseauspider.yuanshen.com Pinging overseauspider.yuanshen.com [0.0.0.0] with 32 bytes of data: PING: transmit failed. General failure. Ping statistics for 0.0.0.0 Packets: Sent = 1, Received = 0, Lost = 1 (100% loss) C:\>ping -n 1 -w 1 log-upload-os.mihoyo.com | find "[0.0.0.0]" Pinging log-upload-os.mihoyo.com [0.0.0.0] with 32 bytes of data: C:\>FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (echo %%i | find "[0.0.0.0]" >nul ) C:\>FOR /f "delims=" %%i IN ('ping -n 1 -w 1 overseauspider.yuanshen.com') DO (echo %%i | find "[0.0.0.0]"; IF !ERRORLEVEL! EQU 0 echo ERR ) ``` All of these terminated instantly. Regardless, if I start the launcher, this happens (attached, in `htop`) and then nothing until I ctrl-c the empty console. I also attached the output of `test_builtins.cmd > test_builtins.log 2>&1`. Edit: apparently you cannot append text files, so here it is on a temporary online storage: https://x0.at/gStk.txt
Krock commented 2 years ago
Owner

I ran the same test on Wine 7.6 and only found the following diff between the outputs:

 --- resetting association
 No open command associated with file type 'footype'
-original value
+buggyXP
 ------------ Testing CALL ------------
 --- external script

https://github.com/wine-mirror/wine/blob/a4e4e19fe0f15b0b9bf67273bb1b27e97474b606/programs/cmd/tests/test_builtins.cmd#L2491-L2500

The launcher script runs and exits as expected on this version.

Would you please be so nice to test launcher.bat in a new wineprefix and another Wine version? The batch file alone is fine. There will be a few errors about missing files, but it's all about whether the script execution gets stuck.

I ran the same test on Wine 7.6 and only found the following diff between the outputs: ``` --- resetting association No open command associated with file type 'footype' -original value +buggyXP ------------ Testing CALL ------------ --- external script ``` https://github.com/wine-mirror/wine/blob/a4e4e19fe0f15b0b9bf67273bb1b27e97474b606/programs/cmd/tests/test_builtins.cmd#L2491-L2500 The launcher script runs and exits as expected on this version. Would you please be so nice to test `launcher.bat` in a new wineprefix and another Wine version? The batch file alone is fine. There will be a few errors about missing files, but it's all about whether the script execution gets stuck.
FichteFoll commented 2 years ago
Poster

You mean like this?

~/tmp Δ WINEPREFIX=$HOME/tmp/wine_test wine ~/code/GI-on-Linux/260/patch_files/launcher.bat
002c:fixme:winediag:LdrInitializeThunk wine-staging 7.5 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
File not found.

regedit: The file 'mhyprot2_running.reg' was not found.
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

 ?=1
~/tmp Σ wine --version
wine-7.5 (Staging)

Same results with wine staging 7.6.

Do you suggest creating a new wine prefix for genshin?

You mean like this? ``` ~/tmp Δ WINEPREFIX=$HOME/tmp/wine_test wine ~/code/GI-on-Linux/260/patch_files/launcher.bat 002c:fixme:winediag:LdrInitializeThunk wine-staging 7.5 is a testing version containing experimental patches. 002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org. File not found. regedit: The file 'mhyprot2_running.reg' was not found. 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 01b0:fixme:exec:SHELL_execute flags ignored: 0x00000100 Application could not be started, or no application associated with the specified file. ShellExecuteEx failed: File not found. ?=1 ~/tmp Σ wine --version wine-7.5 (Staging) ``` Same results with wine staging 7.6. Do you suggest creating a new wine prefix for genshin?
Krock commented 2 years ago
Owner

@FichteFoll Yes exactly. The line ?=1 does not look quite right, but generally the script does run as expected. If you are already using system-wide Wine, you could try to start launcher.bat within the game directory using the very same wineprefix. If this works, I would suggest you to use this prefix and Wine version in Lutris (if possible).

@FichteFoll Yes exactly. The line `?=1` does not look quite right, but generally the script does run as expected. If you are already using system-wide Wine, you could try to start `launcher.bat` within the game directory using the very same wineprefix. If this works, I would suggest you to use this prefix and Wine version in Lutris (if possible).
FichteFoll commented 2 years ago
Poster

?=1 is just how I show non-zero exit codes in my shell prompt.

I'll see about creating a new prefix in the future. Not sure when though because I'm unsure about the time needed and I don't have that much at hand currently.

`?=1` is just how I show non-zero exit codes in my shell prompt. I'll see about creating a new prefix in the future. Not sure when though because I'm unsure about the time needed and I don't have that much at hand currently.
Krock commented 2 years ago
Owner

Wine seems to have changed the command window handling. find.exe is now spawned in a new window and breaks the batch script.

Workaround documented in 46ba552. Please use a terminal emulator or a virtual desktop until this is fixed. Better solutions are of course welcome.

Wine seems to have changed the command window handling. `find.exe` is now spawned in a new window and breaks the batch script. Workaround documented in 46ba552. Please use a terminal emulator or a virtual desktop until this is fixed. Better solutions are of course welcome.
Krock commented 2 years ago
Owner

Workaround documented. This might get fixed in upcoming versions of Wine when I will update the TROUBLESHOOTING document accordingly.

Wine issue. Out of scope to fix within this repository. If the problem still persists in a few releases, it would make sense to submit a bug report.

Workaround documented. This might get fixed in upcoming versions of Wine when I will update the TROUBLESHOOTING document accordingly. Wine issue. Out of scope to fix within this repository. If the problem still persists in a few releases, it would make sense to submit a bug report.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.