https://bugs.winehq.org/show_bug.cgi?id=54251
Bug ID: 54251 Summary: ipconfig /all hangs / freezes / does not exit Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: mjevans1983@gmail.com Distribution: ---
Used the ArchLinux package managers to install wine-git, which made sure I had the correct build tools, git cloned, and tracked the files during install.
At least as of 2023-01-01 something's broken with networking.
My PC has two Ethernet ports on the back, and to have the option of using it as a network switch for my laptop, they're bridged. I also want my PC to have a statically leased DHCP address, so the Ethernet bridge configuration might be a little uncommon, but is not unusual and shouldn't be a problem.
It isn't a problem for ipconfig (no arguments), it isn't a problem for Linux programs, it isn't a problem for curl under wine.
It _is_ a problem for ipconfig /all and I now suspect (after /all failed) also a game I purchased during the recent sales.
$ wine-git cmd
wine: configuration in L"/home/USER/.wine" has been updated. Microsoft Windows 6.1.7601
ipconfig
0058:fixme:nsi:ipv6_forward_enumerate_all not implemented 0058:fixme:nsi:ipv6_forward_enumerate_all not implemented Ethernet adapter lo
Connection-specific DNS suffix. . : IPv6 address. . . . . . . . . . . : ::1 IPv4 address. . . . . . . . . . . : 127.0.0.1 Default gateway . . . . . . . . . :
Ethernet adapter enp8s0
Connection-specific DNS suffix. . : IPv6 address. . . . . . . . . . . : fe00::10%2 Default gateway . . . . . . . . . :
Ethernet adapter enp9s0
Connection-specific DNS suffix. . : Default gateway . . . . . . . . . :
Ethernet adapter br0
Connection-specific DNS suffix. . : IPv6 address. . . . . . . . . . . : fd00::10 IPv6 address. . . . . . . . . . . : 2000::10 IPv6 address. . . . . . . . . . . : fd00::10 IPv6 address. . . . . . . . . . . : 2000::10 IPv6 address. . . . . . . . . . . : fe00::10%4 IPv4 address. . . . . . . . . . . : 192.168.0.10 Default gateway . . . . . . . . . : 192.168.0.1
ipconfig /all
... hangs
The outputs are the same in Proton instances of wine.
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #1 from Michael J Evans mjevans1983@gmail.com --- While running:
# Console 0 mknod "${XDG_RUNTIME_DIR}/winedbg" p cat "${XDG_RUNTIME_DIR}/winedbg" >/dev/null & printf "%s\n" "${!}" > "${XDG_RUNTIME_DIR}/winedbg_pid.cat"
# Console 1 WINEDEBUG=trace+relay,trace+seh wine cmd 2> "${XDG_RUNTIME_DIR}/winedbg"
# Console 0 when ready to open a file kill -9 $(<"${XDG_RUNTIME_DIR}/winedbg_pid.cat") ; cat "${XDG_RUNTIME_DIR}/winedbg" | tee "${XDG_RUNTIME_DIR}/winedbg_log"
Then beginning stderr output collection just prior to invoking:
ipconfig /all
The log file is _massive_, quickly growing to over 1GB in size.
The most interesting call just before that fitful loop appears to be...
0114:Ret KERNEL32.GetComputerNameExA() retval=00000001 ret=646c6c8e
$ grep -n GetComputerNameExA .../winedbg_log
416198:0114:Call KERNEL32.GetComputerNameExA(00000001,00749968,0061f9c8) ret=646c6c67 416237:0114:Ret KERNEL32.GetComputerNameExA() retval=00000001 ret=646c6c67 416238:0114:Call KERNEL32.GetComputerNameExA(00000002,007499ec,0061f9c8) ret=646c6c8e 416277:0114:Ret KERNEL32.GetComputerNameExA() retval=00000001 ret=646c6c8e
$ wc .../winedbg_log 18522370 64877723 1316392777 .../winedbg_log
ipconfig /all ; does this fail because there is not a 'computer name' associated with enp8s0 nor enp9s0 ?
https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi...
Given the context GetComputerNameExA's being provided: a static string?, dynamic return buffer, and a 'DNS domain name of the cluster' sring.
String 2 is likely to be either ComputerNameDnsFullyQualified ComputerNameDnsHostname.
$ hostname -d (none) $ hostname -f AHOSTNAME $ hostname -s AHOSTNAME
I'll double-check if my 'FQDN' hostname is setup correctly; though ipconfig /all should still not _hang_ but rather behave in a more sensible way.
I've added an IPv4, IPv6 (fd00::/8) and IPv6 (2000::/4) static entries with local lan info to my /etc/hosts file.
$ hostname -d lan $ hostname -f AHOSTNAME.lan $ hostname -s AHOSTNAME
Sadly, updating /etc/hosts / hostname results doesn't seem to help wine.
0114:Ret KERNEL32.GetComputerNameExA() retval=00000001 ret=646c6c67 0114:Call KERNEL32.GetComputerNameExA(00000002,007499ec,0061f9c8) ret=646c6c8e 0114:Call ntdll.RtlInitUnicodeString(0061f630,7b092ebc L"System\CurrentControlSet\Services\Tcpip\Parameters") ret=7b05e5a2 0114:Ret ntdll.RtlInitUnicodeString() retval=00000066 ret=7b05e5a2 0114:Call ntdll.NtOpenKeyEx(0061f6bc,00020019,0061f638,00000000) ret=7b05e5d5 0114:Ret ntdll.NtOpenKeyEx() retval=00000000 ret=7b05e5d5 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b05e5ec 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b05e5ec 0114:Call ntdll.RtlInitUnicodeString(0061f548,7b092f22 L"Domain") ret=7b064942 0114:Ret ntdll.RtlInitUnicodeString() retval=0000000e ret=7b064942 0114:Call ntdll.NtQueryValueKey(00000060,0061f548,00000002,0061f550,0000000c,0061f544) ret=7b064c07 0114:Ret ntdll.NtQueryValueKey() retval=80000005 ret=7b064c07 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b0649c1 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b0649c1 0114:Call ntdll.NtClose(00000060) ret=7b0638b7 0114:Ret ntdll.NtClose() retval=00000000 ret=7b0638b7 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b0638c3 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b0638c3 0114:Call ntdll.RtlAllocateHeap(00720000,00000000,00000002) ret=7b067510 0114:Ret ntdll.RtlAllocateHeap() retval=00749520 ret=7b067510 0114:Call ntdll.RtlInitUnicodeString(0061f630,7b092ebc L"System\CurrentControlSet\Services\Tcpip\Parameters") ret=7b05e5a2 0114:Ret ntdll.RtlInitUnicodeString() retval=00000066 ret=7b05e5a2 0114:Call ntdll.NtOpenKeyEx(0061f6bc,00020019,0061f638,00000000) ret=7b05e5d5 0114:Ret ntdll.NtOpenKeyEx() retval=00000000 ret=7b05e5d5 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b05e5ec 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b05e5ec 0114:Call ntdll.RtlInitUnicodeString(0061f548,7b092f22 L"Domain") ret=7b064942 0114:Ret ntdll.RtlInitUnicodeString() retval=0000000e ret=7b064942 0114:Call ntdll.NtQueryValueKey(00000060,0061f548,00000002,0061f550,0000000e,0061f544) ret=7b0649aa 0114:Ret ntdll.NtQueryValueKey() retval=00000000 ret=7b0649aa 0114:Call ntdll.memcpy(00749520,0061f55c,00000002) ret=7b064ca2 0114:Ret ntdll.memcpy() retval=00749520 ret=7b064ca2 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b0649c1 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b0649c1 0114:Call ntdll.NtClose(00000060) ret=7b0638b7 0114:Ret ntdll.NtClose() retval=00000000 ret=7b0638b7 0114:Call ntdll.RtlNtStatusToDosError(00000000) ret=7b0638c3 0114:Ret ntdll.RtlNtStatusToDosError() retval=00000000 ret=7b0638c3 0114:Call ntdll.RtlFreeHeap(00720000,00000000,00749520) ret=7b06755b 0114:Ret ntdll.RtlFreeHeap() retval=00000001 ret=7b06755b 0114:Ret KERNEL32.GetComputerNameExA() retval=00000001 ret=646c6c8e 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,0061f960,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6 0114:Call ntdll.RtlAllocateHeap(00720000,00000000,00000010) ret=646c51aa 0114:Ret ntdll.RtlAllocateHeap() retval=00749520 ret=646c51aa 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,00749520,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6 0114:Call KERNEL32.HeapFree(00720000,00000000,00749520) ret=646c5183 ... Around a gigabyte of looped: ... 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,00749520,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6 0114:Call KERNEL32.HeapFree(00720000,00000000,00749520) ret=646c5183 0114:Ret KERNEL32.HeapFree() retval=00000001 ret=646c5183 0114:Call ntdll.RtlAllocateHeap(00720000,00000000,00000010) ret=646c51aa 0114:Ret ntdll.RtlAllocateHeap() retval=00749520 ret=646c51aa 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,00749520,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6 0114:Call KERNEL32.HeapFree(00720000,00000000,00749520) ret=646c5183 0114:Ret KERNEL32.HeapFree() retval=00000001 ret=646c5183 0114:Call ntdll.RtlAllocateHeap(00720000,00000000,00000010) ret=646c51aa 0114:Ret ntdll.RtlAllocateHeap() retval=00749520 ret=646c51aa 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,00749520,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6 0114:Call KERNEL32.HeapFree(00720000,00000000,00749520) ret=646c5183 0114:Ret KERNEL32.HeapFree() retval=00000001 ret=646c5183 0114:Call ntdll.RtlAllocateHeap(00720000,00000000,00000010) ret=646c51aa 0114:Ret ntdll.RtlAllocateHeap() retval=00749520 ret=646c51aa
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #2 from Hans Leidekker hans@meelstraat.net --- (In reply to Michael J Evans from comment #1)
Around a gigabyte of looped: ... 0114:Call dnsapi.DnsQueryConfig(00000006,00000000,00000000,00000000,00749520,0061f95c) ret=646c51e6 0114:Ret dnsapi.DnsQueryConfig() retval=0000267c ret=646c51e6
That's DNS_ERROR_NO_DNS_SERVERS.
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #3 from Hans Leidekker hans@meelstraat.net --- Created attachment 73813 --> https://bugs.winehq.org/attachment.cgi?id=73813 patch
Does this patch help?
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #4 from Michael J Evans mjevans1983@gmail.com --- I've tested it by editing wine-git/PKGBUILD and saving iphlpapi.diff to the build area's src folder.
# PKGBUILD change, add to prepare() # Psueoshell, modify # cp .../iphlpapi.diff ~/.cache/yay/wine-git/src/ patch --directory="${srcdir}/wine" --forward --strip=1 --input="${srcdir}/iphlpapi.diff"
Retesting ipconfig /all - SUCCESS
ipconfig /all Hostname. . . . . . . . . . . . . : AHOSTNAME Primary DNS suffix. . . . . . . . : lan Node type . . . . . . . . . . . . : Hybrid IP routing enabled. . . . . . . . : No
0058:fixme:nsi:ipv6_forward_enumerate_all not implemented 0058:fixme:nsi:ipv6_forward_enumerate_all not implemented Ethernet adapter lo
Connection-specific DNS suffix. . : Description . . . . . . . . . . . : lo Physical address. . . . . . . . . : DHCP enabled. . . . . . . . . . . : No IPv6 address. . . . . . . . . . . : ::1 IPv4 address. . . . . . . . . . . : 127.0.0.1 Default gateway . . . . . . . . . :
Ethernet adapter enp8s0
Connection-specific DNS suffix. . : Description . . . . . . . . . . . : enp8s0 Physical address. . . . . . . . . : REDACTED DHCP enabled. . . . . . . . . . . : No IPv6 address. . . . . . . . . . . : REDACTED Default gateway . . . . . . . . . :
Ethernet adapter enp9s0
Connection-specific DNS suffix. . : Description . . . . . . . . . . . : enp9s0 Physical address. . . . . . . . . : REDACTED DHCP enabled. . . . . . . . . . . : No Default gateway . . . . . . . . . :
Ethernet adapter br0
Connection-specific DNS suffix. . : Description . . . . . . . . . . . : br0 Physical address. . . . . . . . . : REDACTED DHCP enabled. . . . . . . . . . . : No IPv6 address. . . . . . . . . . . : fd00:REDACTED IPv6 address. . . . . . . . . . . : 2000:REDACTED IPv6 address. . . . . . . . . . . : fd00:REDACTED IPv6 address. . . . . . . . . . . : 2000:REDACTED IPv6 address. . . . . . . . . . . : fe00:REDACTED IPv4 address. . . . . . . . . . . : 192.168.0.10 Default gateway . . . . . . . . . : 192.168.0.1
Now for the bonus stage... does this fix the game I was trying to play in bug #54252 ?
$ find ~/.wine -type f -iname 'iphlp*'
$ find ~/.local/share/Steam/ -type f -iname 'iphlp*'
Looks like I'll need to overwrite the file in the compatibility tool, probably won't be a problem?
~/.local/share/Steam/compatibilitytools.d/GE-Proton7-43/files/lib/wine/i386-windows/iphlpapi.dll ~/.local/share/Steam/compatibilitytools.d/GE-Proton7-43/files/lib64/wine/x86_64-windows/iphlpapi.dll
Also make sure the game's PFX drive uses a symlink not a copied file. $ ls -l ~/.local/share/Steam/steamapps/compatdata/799600/pfx/drive_c/windows/system*/iphlpapi.dll
Copy the 32 and 64 bit versions of the DLL over their targets in .local/share/Steam
That allows Costmoteer to boot to the main menu, which it wasn't before. I have not yet tested any other aspect of network interaction or gameplay.
+
When will the patch be in the main / normal git branch?
What version(s) of wine will see a update with or backport of this patch?
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #5 from Hans Leidekker hans@meelstraat.net --- (In reply to Michael J Evans from comment #4)
When will the patch be in the main / normal git branch?
Wine is currently in code freeze. I expect development to resume in a couple of weeks.
https://bugs.winehq.org/show_bug.cgi?id=54251
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|UNCONFIRMED |RESOLVED
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- This is actually a duplicate of bug 52557.
*** This bug has been marked as a duplicate of bug 52557 ***
https://bugs.winehq.org/show_bug.cgi?id=54251
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Gijs Vermeulen gijsvrm@gmail.com --- Closing DUPLICATE.
https://bugs.winehq.org/show_bug.cgi?id=54251
--- Comment #8 from Michael J Evans mjevans1983@gmail.com --- Has this patch been included in the upcoming release?
Hans Leidekker 2023-01-02 10:40:43 UTC
Created attachment 73813 [details] patch
Does this patch help?
----
Literally one line of a loop escape.
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index a95a581532f..f8fb5de3f0e 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -2599,6 +2599,7 @@ static DWORD get_dns_server_list( const NET_LUID *luid, IP_ADDR_STRING *list, IP for (;;) { err = DnsQueryConfig( DnsConfigDnsServerList, 0, NULL, NULL, servers, &array_len ); + if (err != ERROR_SUCCESS && err != ERROR_MORE_DATA) goto err; num = (array_len - FIELD_OFFSET(IP4_ARRAY, AddrArray[0])) / sizeof(IP4_ADDRESS); needed = num * sizeof(IP_ADDR_STRING); if (!list || *len < needed)