https://bugs.winehq.org/show_bug.cgi?id=49938
Bug ID: 49938 Summary: Repeating "00fc:err:service:validate_context_handle Handle is of an invalid type (1, 2)" at startup Product: Wine Version: 5.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: advapi32 Assignee: wine-bugs@winehq.org Reporter: b7.10110111@gmail.com Distribution: ---
After Wine upgrade to current master (cce4f36e214125173a8df84d27ba5b33df8d1434) I now have to wait for about half a minute to launch any program in Wine — even winecfg. Here's what I see in the console (TICK prints are to show 0.5s delays):
``` $ while sleep 0.5; do echo TICK; done & winecfg [1] 15278 0050:err:service:validate_context_handle Handle is of an invalid type (1, 2) TICK 0050:err:service:validate_context_handle Handle is of an invalid type (1, 2) 0060:err:ole:start_rpcss Failed to start RpcSs service 0060:err:ole:NDRCContextBinding invalid handle 00856188 TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK 0074:err:service:validate_context_handle Handle is of an invalid type (1, 2) 0060:err:ole:start_rpcss Failed to start RpcSs service 0060:err:ole:NDRCContextBinding invalid handle 00854A10 TICK TICK 003c:fixme:service:scmdatabase_autostart_services Auto-start service L"NDIS" failed to start: 1053 0074:err:service:validate_context_handle Handle is of an invalid type (1, 2) TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK 003c:fixme:service:scmdatabase_autostart_services Auto-start service L"PlugPlay" failed to start: 1053 009c:err:service:validate_context_handle Handle is of an invalid type (1, 2) TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK 003c:fixme:service:scmdatabase_autostart_services Auto-start service L"WineBus" failed to start: 1053 00b4:err:service:validate_context_handle Handle is of an invalid type (1, 2) TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK 003c:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1053 00cc:err:service:validate_context_handle Handle is of an invalid type (1, 2) TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK TICK 003c:fixme:service:scmdatabase_autostart_services Auto-start service L"MountMgr" failed to start: 1053 TICK 00ec:err:service:validate_context_handle Handle is of an invalid type (1, 2) 00dc:err:ole:start_rpcss Failed to start RpcSs service 00dc:err:ole:NDRCContextBinding invalid handle 008566A0 ```
At the end of this log the winecfg window finally appears.
This is a regression, to which git-bisect gave the following output:
e9090e1c903578b30118ce9559c1824361abc6da is the first bad commit commit e9090e1c903578b30118ce9559c1824361abc6da Author: Hans Leidekker hans@codeweavers.com Date: Mon Sep 7 14:10:13 2020 +0200
advapi32: Reimplement SystemFunction036 using system interrupt information.
Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
:040000 040000 c6d1fe863cec8623d492795bb4c55031ba8bdd1f a1213f0b61b72768e15e37c6dc60f98cc7565566 M dlls
https://bugs.winehq.org/show_bug.cgi?id=49938
Ruslan Kabatsayev b7.10110111@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |e9090e1c903578b30118ce9559c | |1824361abc6da Keywords| |regression
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- Is this a fresh prefix? Can you revert that patch and see if it restores the old behavior?
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #2 from Ruslan Kabatsayev b7.10110111@gmail.com --- (In reply to Hans Leidekker from comment #1)
Is this a fresh prefix? Can you revert that patch and see if it restores the old behavior?
No, this is an old prefix. And, I've already tried resetting to the commit before the "bad" one, and the problem doesn't reproduce there.
Trying with a fresh prefix in /tmp/wine gives the following result (in short, no delays, although the "Handle is of an invalid type (1, 2)" is still repeated):
``` ruslan@IntegralH(17:41) [ /tmp ]$ mkdir wine ruslan@IntegralH(17:41) [ /tmp ]$ export WINEPREFIX=/tmp/wine ruslan@IntegralH(17:41) [ /tmp ]$ winecfg 0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0050:err:ole:start_rpcss Failed to open RpcSs service 0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"BrotherHL-5250DN" fails 0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"EPSON_AL-C1100" fails 0040:fixme:winspool:AddPrinterW DocumentPropertiesW on printer L"EPSON_Epson_Stylus_Office_B42WD" fails 0064:fixme:file:NtLockFile I/O completion on lock not implemented yet 0064:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0064:err:mscoree:LoadLibraryShim error reading registry key for installroot 0064:err:mscoree:LoadLibraryShim error reading registry key for installroot 0064:err:mscoree:LoadLibraryShim error reading registry key for installroot 0064:err:mscoree:LoadLibraryShim error reading registry key for installroot 006c:fixme:file:NtLockFile I/O completion on lock not implemented yet 006c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 006c:err:mscoree:LoadLibraryShim error reading registry key for installroot 006c:err:mscoree:LoadLibraryShim error reading registry key for installroot 006c:err:mscoree:LoadLibraryShim error reading registry key for installroot 006c:err:mscoree:LoadLibraryShim error reading registry key for installroot 006c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5) 006c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 5) 0064:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0064:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 007c:fixme:file:NtLockFile I/O completion on lock not implemented yet 007c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 007c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 007c:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0040:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution. 0084:fixme:iphlpapi:NotifyIpInterfaceChange (family 0, callback 0x6a0df537, context 0xd19048, init_notify 0, handle 0x155fccc): stub 0040:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 00d8:err:service:validate_context_handle Handle is of an invalid type (1, 2) 0040:err:ole:NDRCContextBinding invalid handle 001BDBA8 0040:err:ole:NDRCContextBinding invalid handle 001BDBA8 00d8:err:service:validate_context_handle Handle is of an invalid type (1, 2) 002c:err:ole:NDRCContextBinding invalid handle 001B6DE0 00d8:err:service:validate_context_handle Handle is of an invalid type (1, 2) 002c:err:setupapi:SetupDiInstallDevice Failed to start service L"winebus" for device L"ROOT\WINE\WINEBUS", error 6. 002c:err:ole:NDRCContextBinding invalid handle 001BAB40 00d8:err:service:validate_context_handle Handle is of an invalid type (1, 2) 002c:err:ole:NDRCContextBinding invalid handle 001BA3D0 00d8:err:service:validate_context_handle Handle is of an invalid type (1, 2) 002c:err:setupapi:SetupDiInstallDevice Failed to start service L"wineusb" for device L"ROOT\WINE\WINEUSB", error 6. 002c:err:ole:NDRCContextBinding invalid handle 001B6D78 wine: configuration in L"/tmp/wine" has been updated. ruslan@IntegralH(17:41) [ /tmp ]$ winecfg 0048:err:ole:start_rpcss Failed to open RpcSs service 010c:err:ole:start_rpcss Failed to open RpcSs service ```
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #3 from Ruslan Kabatsayev b7.10110111@gmail.com --- (In reply to Hans Leidekker from comment #1)
Is this a fresh prefix? Can you revert that patch and see if it restores the old behavior?
OK, now tried actual git-revert, and after adding the missing `#include <fcntl.h>` it compiled fine. With this version (cce4f36e214125173a8df84d27ba5b33df8d1434 + revert + add include) things work fine again—no error messages, no delays.
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #4 from Hans Leidekker hans@meelstraat.net --- Please attach a WINEDEBUG=+crypt,+ntdll trace from current git.
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #5 from Ruslan Kabatsayev b7.10110111@gmail.com --- Created attachment 68326 --> https://bugs.winehq.org/attachment.cgi?id=68326 WINEDEBUG=+crypt,+ntdll winecfg
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #6 from Hans Leidekker hans@meelstraat.net --- Created attachment 68327 --> https://bugs.winehq.org/attachment.cgi?id=68327 debug patch
Thanks. Can you apply this debug patch and get a WINEDEBUG=+timestamp,+ntdll trace?
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #7 from Ruslan Kabatsayev b7.10110111@gmail.com --- Created attachment 68328 --> https://bugs.winehq.org/attachment.cgi?id=68328 WINEDEBUG=+timestamp,+ntdll winecfg
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #8 from Hans Leidekker hans@meelstraat.net --- (In reply to Ruslan Kabatsayev from comment #7) 98741.147:0060:trace:ntdll:NtQuerySystemInformation (0x00000017,0x7e8ecd20,0x000000c0,(nil)) 98741.147:0060:fixme:ntdll:NtQuerySystemInformation getrandom returned -1 errno 38
So getrandom() returns ENOSYS. This suggests you're running glibc new enough to have a wrapper for the syscall on a kernel that doesn't implement this syscall. Can you describe your setup in more detail?
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #9 from Ruslan Kabatsayev b7.10110111@gmail.com --- (In reply to Hans Leidekker from comment #8)
So getrandom() returns ENOSYS. This suggests you're running glibc new enough to have a wrapper for the syscall on a kernel that doesn't implement this syscall. Can you describe your setup in more detail?
My system is LFS with x86_64 Linux 4.14.157, 32-bit userland with glibc 2.27 (configured with --enable-kernel=3.2, as suggested in the LFS book).
As I've tested now, it's glibc that raises ENOSYS, not the kernel. Particularly, another glibc from cross-x86_64 toolchain executes the actual syscall, which succeeds, while this system glibc just executes its #else code for #ifdef __NR_getrandom in getrandom.c.
Do you think I have misconfigured my system somehow?
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #10 from Hans Leidekker hans@meelstraat.net --- (In reply to Ruslan Kabatsayev from comment #9)
(In reply to Hans Leidekker from comment #8)
So getrandom() returns ENOSYS. This suggests you're running glibc new enough to have a wrapper for the syscall on a kernel that doesn't implement this syscall. Can you describe your setup in more detail?
My system is LFS with x86_64 Linux 4.14.157, 32-bit userland with glibc 2.27 (configured with --enable-kernel=3.2, as suggested in the LFS book).
getrandom() was introduced in 3.17, and glibc supports it since 2.25, so you have support for it. It seems that building with --enable-kernel=3.2 disables it.
As I've tested now, it's glibc that raises ENOSYS, not the kernel. Particularly, another glibc from cross-x86_64 toolchain executes the actual syscall, which succeeds, while this system glibc just executes its #else code for #ifdef __NR_getrandom in getrandom.c.
Do you think I have misconfigured my system somehow?
Yeah, this is likely to break more than just Wine.
https://bugs.winehq.org/show_bug.cgi?id=49938
Ruslan Kabatsayev b7.10110111@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #11 from Ruslan Kabatsayev b7.10110111@gmail.com --- This should be fixed on my system then. Thanks for your help.
https://bugs.winehq.org/show_bug.cgi?id=49938
--- Comment #12 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=49938
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #13 from Austin English austinenglish@gmail.com --- Closing.