https://bugs.winehq.org/show_bug.cgi?id=46633
Bug ID: 46633 Summary: unimplemented function: kernel32.dll.startthreadpoolio Product: Wine Version: 4.0-rc2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: mushipao@gmail.com Distribution: ---
Created attachment 63542 --> https://bugs.winehq.org/attachment.cgi?id=63542 backtrace of exception
3rd party, proprietary software errors out in Wine.
0157:fixme:thread:CreateThreadpoolIo (0x64, 0x42fca0, 0x5fc2a0, (nil)): stub wine: Call from 0x7bc51e39 to unimplemented function KERNEL32.dll.StartThreadpoolIo, aborting wine: Call from 0x7bc51e39 to unimplemented function KERNEL32.dll.StartThreadpoolIo, aborting wine: Call from 0x7bc51e39 to unimplemented function KERNEL32.dll.StartThreadpoolIo, aborting wine: Call from 0x7bc51e39 to unimplemented function KERNEL32.dll.StartThreadpoolIo, aborting wine: Call from 0x7bc51e39 to unimplemented function KERNEL32.dll.StartThreadpoolIo, aborting wine: Unimplemented function KERNEL32.dll.StartThreadpoolIo called at address 0x7bc51e39 (thread 0157), starting debugger...
https://bugs.winehq.org/show_bug.cgi?id=46633
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox.xerox2000x@gmail.com
--- Comment #1 from Louis Lenders xerox.xerox2000x@gmail.com --- Created attachment 63820 --> https://bugs.winehq.org/attachment.cgi?id=63820 patch with stub for StartThreadpoolIo
Hi,
does this patch (with stubbed StartThreadpoolIo) help anything?
Could you try and report back please? Thanks in advance and regards
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #2 from mushipao@gmail.com --- Hello!
Thanks for your time and patch. It does help! No crash now, just a hang. Please let me know what other info I can give you.
0035:fixme:thread:CreateThreadpoolIo (0x90, 0x475a00, 0x659950, (nil)): stub 0035:fixme:thread:StartThreadpoolIo ((nil)): stub 0034:err:ntdll:RtlpWaitForCriticalSection section 0x1f5bfc "?" wait timed out in thread 0034, blocked by 0035, retrying (60 sec) 0034:err:ntdll:RtlpWaitForCriticalSection section 0x1f5bfc "?" wait timed out in thread 0034, blocked by 0035, retrying (60 sec) etc.....
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to mushipao from comment #2)
Hello!
Thanks for your time and patch. It does help! No crash now, just a hang. Please let me know what other info I can give you.
0035:fixme:thread:CreateThreadpoolIo (0x90, 0x475a00, 0x659950, (nil)): stub
maybe it needs real implementation of CreateThreadpoolIo (and startthreadpoolio)
Is it possible to start the program setting windows version to XP? Could you try that (set version to XP in winecfg)? Thanks.
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #4 from mushipao@gmail.com --- (In reply to Louis Lenders from comment #3)
maybe it needs real implementation of CreateThreadpoolIo (and startthreadpoolio)
Is it possible to start the program setting windows version to XP? Could you try that (set version to XP in winecfg)? Thanks.
Gave it a go in XP, still hangs on RtlpWaitForCriticalSection. It is the same for win7, win10 modes as well.
I am surprised that there isn't an implementation for Threadpools! Or if this particular variant is just a rarely used call?
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #5 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to mushipao from comment #4)
(In reply to Louis Lenders from comment #3)
Gave it a go in XP, still hangs on RtlpWaitForCriticalSection.
Are the fixme`s for CreateThreadpoolIO an StartThreadPoolIo still present in the consoleoutput when you run in XP-mode?
If not that might indicate the hang is not due to these stubs. Could you see please?
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #6 from mushipao@gmail.com --- Created attachment 63848 --> https://bugs.winehq.org/attachment.cgi?id=63848 output from xp and win10
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #7 from Louis Lenders xerox.xerox2000x@gmail.com --- (In reply to mushipao from comment #6)
Created attachment 63848 [details] output from xp and win10
Well, it also calls this CreateThreadPoolIo in Xp mode, i thought MSDN suggested it was only present from Vista on, but guess that`s not true then(?)
My guess for now would be it needs real implementation then of these functions.
Maybe you could get a last clue starting the program with winedbg.
From the info site:
3.2 Program hangs, nothing happens
Start the program with winedbg instead of wine. When the program locks up switch to the winedbg terminal and press Ctrl+C. This will stop the program and let you debug the program as you would for a crash.
So hit a few times `c` (continue) until it hangs, and after the aforementioned ctrl^c type `bt`, maybe it reveals something (???)
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #8 from mushipao@gmail.com --- Created attachment 63853 --> https://bugs.winehq.org/attachment.cgi?id=63853 Backtrace through winedbg
I tried to continue again after the first backtrace, but the second looks exactly the same.
https://bugs.winehq.org/show_bug.cgi?id=46633
--- Comment #9 from mushipao@gmail.com --- (In reply to Louis Lenders from comment #7)
Well, it also calls this CreateThreadPoolIo in Xp mode, i thought MSDN suggested it was only present from Vista on, but guess that`s not true then(?)
I would guess the exe I'm trying to run is not smart enough to know which version its running under--it just assumes that you chose a compatible OS!
Maybe you could get a last clue starting the program with winedbg.
Thanks for walking me through it :)
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #10 from Zebediah Figura z.figura12@gmail.com --- Created attachment 66298 --> https://bugs.winehq.org/attachment.cgi?id=66298 partial implementation
The big problem with threadpool I/O (and probably the reason it wasn't implemented sooner) is that the kernel32 and ntdll callbacks differ, but there's no obvious way to thunk from the ntdll callback to the kernel32 callback without leaking memory.
I took the liberty of at least implementing the ntdll part, and adding tests for the kernel32 part.
https://bugs.winehq.org/show_bug.cgi?id=46633
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=46633
Jacek Caban jacek@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jacek@codeweavers.com
--- Comment #11 from Jacek Caban jacek@codeweavers.com --- Created attachment 66862 --> https://bugs.winehq.org/attachment.cgi?id=66862 new patchset
(In reply to Zebediah Figura from comment #10)
there's no obvious way to thunk from the ntdll callback to the kernel32 callback without leaking memory.
One way to do it is in the attached patch (together with rebased version of ntdll patches). It's not pretty, but I'd say it's not too bad given that we don't have any other solution.
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #66862|1 |0 is patch| | Attachment #66862|text/plain |application/x-compressed-ta mime type| |r
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|unimplemented function: |Multiple applications need |kernel32.dll.startthreadpoo |threadpool I/O (MariaDB |lio |mysqld, Mono's | |System.Threading.ThreadPool | |BoundHandle)
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com
--- Comment #12 from Zebediah Figura z.figura12@gmail.com --- *** Bug 48542 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=46633
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |b66e13ef249065abf693500faa7 | |7d0161bc92a11
--- Comment #13 from Zebediah Figura z.figura12@gmail.com --- This is implemented in Wine as of https://source.winehq.org/git/wine.git/commitdiff/b66e13ef249065abf693500faa77d0161bc92a11; thanks Jacek.
https://bugs.winehq.org/show_bug.cgi?id=46633
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.7.