[cfe-users] Deadlock issues with multithreaded use of libclang on windows

Michael Steinberg via cfe-users cfe-users at lists.llvm.org
Sat Jul 28 04:28:02 PDT 2018


Greetings,

I'm attempting to use a libclang-based language server in vscode for 
cross compiling projects. This language server is working multithreaded 
and I'm experiencing deadlocks which seem to come frome a race 
condition, e.g. when I use a debug build of libclang they happen less 
frequently presumably because the ratio of time spent parsing sources 
and time spent starting/stopping threads changes and makes it less 
likely to hit the condition.

Whenever I do hit the deadlock, I observed there are two threads around 
that are related to clang querying a visual studio installation for 
platform specifics ("libclang.dll!findVCToolChainViaSetupConfig").
Here is a dump of all the stack traces in such a situation: 
https://www.paste.org/94037

Now my question is two-fold:
- Since I am cross compiling with a gcc, I don't really need clang to 
query microsoft platform stuff. If there was a way to suppress these 
queries, my hope is that the deadlocks disappear. Is there a way to 
suppress this?
- Are you aware of ways for me to get more detailed information on the 
deadlock situation with the VS.community debugger? I could not easily 
find information on which locks the OS exactly tried to get, only that 
it tried to get *some* lock by the calls visible in the stack traces. Is 
there something built-in and readily available to debug such situations 
that I missed?

Any help sorting this out is highly appreciated.

Kind regards
Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20180728/71518893/attachment.html>


More information about the cfe-users mailing list