https://bugs.winehq.org/show_bug.cgi?id=51083
Bug ID: 51083 Summary: Deadlock in llvm-mingw compiled app Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: vladimir.kokovic@gmail.com Distribution: ---
Created attachment 69945 --> https://bugs.winehq.org/attachment.cgi?id=69945 wine log
I have one test program (pomocni-llvm-mingw.exe) who acts very strangely in wine git version(Wine-6.7-175-G2Deb8C2825A) while in the Windows10 does not work at all.
What the most surprise is that although the wine64 call is terminated for the specified program, wine processes and the program itself remain in memory and after interruptions:
[root@vlada-kuci tmp 21:17:48]$ /asoft-src/ispp-64/linux/cross-compile/llvm-mingw/pomocni-cross-llvm-mingw/pomocni-cross-mingw64.sh
/tmp/pomocni-cross-mingw64.log 2>&1
^C[root@vlada-kuci tmp 01:00:13]$ [root@vlada-kuci tmp 01:00:15]$ [root@vlada-kuci tmp 01:00:15]$ ps -ef | grep pomocni root 419722 1 0 00:57 pts/16 00:00:00 pomocni-llvm-mingw.exe DRIVER=PostgreSQL;DATABASE=ispp-pprostor-beograd;SERVER=localhost;UID=vlada;PWD=vladakk;MaxVarcharSize=65536;MaxLongVarcharSize=65536;ByteaAsLongVarBinary=1 root 419932 1456 0 01:08 pts/16 00:00:00 grep pomocni [root@vlada-kuci tmp 01:08:41]$ ps -ef | grep win root 419631 1 0 00:55 ? 00:00:25 /mnt/WD-Elements-25A1/src/wine-git/install64/bin/wineserver root 419637 1 0 00:55 ? 00:00:00 C:\windows\system32\services.exe root 419640 1 0 00:55 ? 00:00:13 C:\windows\system32\winedevice.exe root 419647 1 0 00:55 ? 00:00:00 C:\windows\system32\plugplay.exe root 419655 1 1 00:55 ? 00:05:57 C:\windows\system32\winedevice.exe root 419672 1 0 00:55 ? 00:00:00 C:\windows\system32\svchost.exe -k LocalServiceNetworkRestricted root 419677 1 0 00:55 ? 00:00:00 C:\windows\system32\rpcss.exe root 419716 1 0 00:57 pts/16 00:00:00 C:\windows\system32\conhost.exe --unix --width 0 --height 0 --server 0x30 root 422318 1456 0 06:38 pts/16 00:00:00 grep win
The program is made with the latest version of llvm-mingw:Clang Version 11.0.0 (https://github.com/llvm/llvm-project.git 176249bd6732a8044d457092ed922768724a6f06).
That same program when it is made and performed in Linux works correctly as predicted.
In the attachment, I send the following files:
1. wine log - pomocni-cross-mingw64.log
2. exe characteristics - trt.log
3. test script - pomocni-cross-mingw64.sh
4. test program - testIsppRadenik.cpp
Vladimir Koković, DP senior(70),
Serbia, Belgrade, 1.May 2021
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #1 from Vladimir Koković vladimir.kokovic@gmail.com --- Created attachment 69946 --> https://bugs.winehq.org/attachment.cgi?id=69946 exe characteristics
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #2 from Vladimir Koković vladimir.kokovic@gmail.com --- Created attachment 69947 --> https://bugs.winehq.org/attachment.cgi?id=69947 test script
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #3 from Vladimir Koković vladimir.kokovic@gmail.com --- Created attachment 69948 --> https://bugs.winehq.org/attachment.cgi?id=69948 test program
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #4 from Vladimir Koković vladimir.kokovic@gmail.com --- During the last test, I got with the last version(wine-6.7-246-gcda4abac985) in the log file next: 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) ... But $WINEPREFIX/bin/winedbg --command "info proc" shows: pid threads executable (all id:s are in hex) 0000011c 1 'start.exe' 00000124 1 _ 'conhost.exe' 00000060 3 'explorer.exe' 00000038 7 'services.exe' 000000d4 6 _ 'rpcss.exe' 000000c0 3 _ 'svchost.exe' 00000084 7 _ 'winedevice.exe' 00000068 5 _ 'plugplay.exe' 00000044 4 _ 'winedevice.exe' 00000020 1 'start.exe' 00000100 1 _ 'cmd.exe' 00000110 2 _ 'pomocni-llvm-mingw.exe' 000000f8 1 _ 'conhost.exe'
And from this, it is seen that 0118 and 0114 do not exist in the list!
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #5 from Vladimir Koković vladimir.kokovic@gmail.com --- wine64 version=wine-6.7-315-ga64861fb66b
And now a new moment I didn't expect, the problem with the GCC compiled exe: 0114:err:ntdll:RtlpWaitForCriticalSection section 00000000709DB2E0 "?" wait timed out in thread 0114, blocked by 0000, retrying (60 sec) 0114:err:ntdll:RtlpWaitForCriticalSection section 00000000709DB2E0 "?" wait timed out in thread 0114, blocked by 0000, retrying (60 sec) 0114:err:ntdll:RtlpWaitForCriticalSection section 00000000709DB2E0 "?" wait timed out in thread 0114, blocked by 0000, retrying (60 sec) ... The question is what does thread 0000 mean ?
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #6 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.8
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #7 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.9
https://bugs.winehq.org/show_bug.cgi?id=51083
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov@gmail.com
--- Comment #8 from Damjan Jovanovic damjan.jov@gmail.com --- Please start winedbg during the deadlock, run "bt all" and post the output. Hopefully we can see what that other thread is doing that's keeping it from releasing the lock (unless it leaked the lock instead).
https://bugs.winehq.org/show_bug.cgi?id=51083
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase Version|unspecified |6.7
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #9 from Vladimir Koković vladimir.kokovic@gmail.com --- (In reply to Damjan Jovanovic from comment #8)
Please start winedbg during the deadlock, run "bt all" and post the output. Hopefully we can see what that other thread is doing that's keeping it from releasing the lock (unless it leaked the lock instead).
My primary question is how to start winedbg ? Here's what the situation is at that moment.
ps -ef | grep pomocni root 367122 1303 0 07:10 pts/16 00:00:00 /bin/bash /asoft-src/ispp-64/linux/cross-compile/llvm-mingw/pomocni-cross-llvm-mingw/pomocni-cross-mingw64.sh root 367187 1 0 07:10 pts/16 00:00:00 C:\windows\system32\cmd.exe /C z:\tmp\vk-pomocni-cross-llvm-mingw.bat root 367191 1 0 07:10 pts/16 00:00:00 pomocni-llvm-mingw.exe DRIVER=PostgreSQL;DATABASE=ispp-pprostor-beograd;SERVER=localhost;UID=vlada;PWD=vladakk;MaxVarcharSize=65536;MaxLongVarcharSize=65536;ByteaAsLongVarBinary=1 root 367218 1305 0 07:14 pts/18 00:00:00 grep pomocni
pid threads executable (all id:s are in hex) 0000011c 1 'start.exe' 00000124 1 _ 'conhost.exe' 00000068 3 'explorer.exe' 00000038 7 'services.exe' 000000d4 6 _ 'rpcss.exe' 000000c0 3 _ 'svchost.exe' 00000080 7 _ 'winedevice.exe' 00000060 5 _ 'plugplay.exe' 00000044 4 _ 'winedevice.exe' 00000020 1 'start.exe' 00000100 1 _ 'cmd.exe' 00000110 2 _ 'pomocni-llvm-mingw.exe' 000000f8 1 _ 'conhost.exe'
0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec)
0118 and 0114 do not exist !
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #10 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Vladimir Koković from comment #9)
0118 and 0114 do not exist !
Yes, because those are thread IDs, not process IDs. Try "info thread".
Please run this: winedbg --command "bt all" during the deadlock, and post the output, as well as wine's console output.
https://bugs.winehq.org/show_bug.cgi?id=51083
Zebediah Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #11 from Zebediah Figura z.figura12@gmail.com --- (In reply to Damjan Jovanovic from comment #10)
(In reply to Vladimir Koković from comment #9)
0118 and 0114 do not exist !
Yes, because those are thread IDs, not process IDs. Try "info thread".
Please run this: winedbg --command "bt all" during the deadlock, and post the output, as well as wine's console output.
The sample binary is attached; can you do this yourself?
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #12 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Zebediah Figura from comment #11)
(In reply to Damjan Jovanovic from comment #10)
(In reply to Vladimir Koković from comment #9)
0118 and 0114 do not exist !
Yes, because those are thread IDs, not process IDs. Try "info thread".
Please run this: winedbg --command "bt all" during the deadlock, and post the output, as well as wine's console output.
The sample binary is attached; can you do this yourself?
There is no binary, only a source file with missing headers and a shell script.
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #13 from Vladimir Koković vladimir.kokovic@gmail.com --- (In reply to Damjan Jovanovic from comment #12)
(In reply to Zebediah Figura from comment #11)
(In reply to Damjan Jovanovic from comment #10)
(In reply to Vladimir Koković from comment #9)
0118 and 0114 do not exist !
Yes, because those are thread IDs, not process IDs. Try "info thread".
Please run this: winedbg --command "bt all" during the deadlock, and post the output, as well as wine's console output.
The sample binary is attached; can you do this yourself?
There is no binary, only a source file with missing headers and a shell script.
man winedbg SYNOPSIS winedbg [ options ] [ program_name [ program_arguments ] | wpid ] where is thread ?
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #14 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Vladimir Koković from comment #13)
where is thread ?
$ winedbg --command "info thread"
process tid prio (all id:s are in hex) 00000020 start.exe 00000024 0 00000030 winemenubuilder.exe 00000034 0
00000020 is the process ID for start.exe, 00000024 is the tid (thread ID) inside that start.exe process.
But don't worry about that. winedbg --command "bt all" gives stack traces for all threads in all processes. That should help here. You don't need anything else.
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #15 from Vladimir Koković vladimir.kokovic@gmail.com --- Oh yes, and log file is attached ?
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #16 from Vladimir Koković vladimir.kokovic@gmail.com --- Created attachment 70062 --> https://bugs.winehq.org/attachment.cgi?id=70062 bt all
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #17 from Damjan Jovanovic damjan.jov@gmail.com --- 00000110 4 _ 'pomocni-llvm-mingw.exe'
but:
Can't attach process 0110: error 5
warning: could not attach to 0110 Can't attach process 0110: error 5
warning: could not attach to 0110 Can't attach process 0110: error 5
warning: could not attach to 0110 Can't attach process 0110: error 5
warning: could not attach to 0110
Error 5 is: #define ERROR_ACCESS_DENIED 5
Maybe you need to disable selinux, or: echo 0 > /proc/sys/kernel/yama/ptrace_scope or something else that's denying you access.
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #18 from Vladimir Koković vladimir.kokovic@gmail.com --- (In reply to Damjan Jovanovic from comment #14)
(In reply to Vladimir Koković from comment #13)
where is thread ?
$ winedbg --command "info thread"
process tid prio (all id:s are in hex) 00000020 start.exe 00000024 0 00000030 winemenubuilder.exe 00000034 0
00000020 is the process ID for start.exe, 00000024 is the tid (thread ID) inside that start.exe process.
But don't worry about that. winedbg --command "bt all" gives stack traces for all threads in all processes. That should help here. You don't need anything else.
man winedbg Stack manipulation bt Print calling stack of current thread. bt N Print calling stack of thread of ID N. Note: this doesn't change the position of the current frame as manipulated by the up & dn commands).
Where is "bt all" ?
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #19 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Vladimir Koković from comment #18)
Where is "bt all" ?
$ winedbg Wine-dbg>help ... bt [<tid>|all] frame <n> ...
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #20 from Vladimir Koković vladimir.kokovic@gmail.com --- Now I have another situation when I did kill all wine processes ! After the start "bt all", this process is now waiting and does not open my process 0110 but is in the "bt all" log file last process is 0104.
In my "pomocni-cross-llvm-mingw" log file is now logged in, after starting "BT ALL" next: 0118:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0118, blocked by 0114, retrying (60 sec) 00bc:err:wineusb:event_thread_proc Error handling events: System call interrupted (perhaps due to signal) 00bc:err:wineusb:event_thread_proc Error handling events: System call interrupted (perhaps due to signal) 00bc:err:wineusb:event_thread_proc Error handling events: System call interrupted (perhaps due to signal) 018c:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 018c, blocked by 0114, retrying (60 sec)
When I do Kill "llvm-mingw-Linux>pomocni-llvm-mingw.exe" in "bt all" log file, you can see the following at the end: Process of pid=0110 has terminated Exception c0000005
This is most likely to mean that winedbg cannot do attach to 0110 due to the interrupt that occurred by the USB component.
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #21 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.10, with different numbers: 0130:err:ntdll:RtlpWaitForCriticalSection section 000000007BC61540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0130, blocked by 012c, retrying (60 sec)
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #22 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.11 ...
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #23 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.12 ...
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #24 from Vladimir Koković vladimir.kokovic@gmail.com --- (In reply to Vladimir Koković from comment #23)
The same problem exists with wine version=wine-6.12 ...
0128:err:ntdll:RtlpWaitForCriticalSection section 000000007BC62540 "../wine/dlls/ntdll/loader.c: loader_section" wait timed out in thread 0128, blocked by 0124, retrying (60 sec)
Additional information on the basis of 'info thread' ---------------------------------------------------- process tid prio (all id:s are in hex) 00000020 start.exe 00000024 0 00000038 services.exe 0000003c 0 00000040 0 0000004c 0 00000068 0 000000a8 0 000000c0 0 000000d4 0 00000044 winedevice.exe 00000048 0 00000054 0 00000058 0 0000005c 0 00000060 winedevice.exe 00000064 0 0000006c 0 00000070 0 00000074 0 00000094 0 00000098 0 0000009c 0 00000078 explorer.exe 0000007c 0 00000084 0 00000088 0 000000a0 plugplay.exe 000000a4 0 000000ac 0 000000b0 0 000000b4 0 000000b8 svchost.exe 000000bc 0 000000c4 0 000000c8 0 000000cc rpcss.exe 000000d0 0 000000d8 0 000000dc 0 000000e0 0 000000e4 0 000000e8 0 000000f0 conhost.exe 000000f4 0 000000f8 cmd.exe 000000fc 0 00000120 pomocni-llvm-mingw.exe 00000124 0 00000128 0 0000012c start.exe 00000130 0 00000134 conhost.exe 00000138 0 0000013c cmd.exe 00000140 0
https://bugs.winehq.org/show_bug.cgi?id=51083
--- Comment #25 from Vladimir Koković vladimir.kokovic@gmail.com --- The same problem exists with wine version=wine-6.13-76-gc518a5362b9 ...