Skip to content

Bug Clang 17/19. Error build any coroutines library on Windows in Visual Studio 2022 #119255

@artemsazonov86

Description

@artemsazonov86

I am using Clang in Visual Studio and I have encountered a problem that causes the compiler to crash. This is not a compilation error, but a crash of the compiler process itself during the build.
I am trying to build libraries such as cppcoro and concurencpp and I get similar errors. In the case of cppcoro, after generating a Visual Studio project in CMake, I can correctly compile the library and get .lib files, but when I include this library and its header files in my project and write a simple coroutine, the compiler crashes. With the concurencpp library, the situation is a little different, I can't even build it from source codes, when compiling some of its .cpp files, the compiler crashes. Perhaps this is a compatibility issue between clang and the Visual Studio development environment (I think clang-cl is used in this case) or the standard library installed with Visual Studio. I don't know for sure. I checked the same code with MSYS2, and it was built correctly, Visual Studio is not installed on that machine, and there are no libraries that are installed with it. That is, building with MSYS/Mingw with clang is successful, I can compile both libraries into .lib files, and I correctly build my main.cpp and everything works. That is, this bug appears only on the machine where Visual Studio is installed and where I installed clang from the official LLVM repository from the LLVM-19.1.5-win64.exe file.
Below I will give detailed information about the versions of the software used and the compilation log with errors:

clang version 17.0.5
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang version 19.1.5
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM19\bin
Visual Studio Enterprise 2022 17.7.6

Here is the log of the attempt to build the concurencpp library:

C:\local\concurrencpp-v.0.1.7\build>ninja
[12/16] Building CXX object CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj
FAILED: CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj
clang++  -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj -MF CMakeFiles\concurrencpp.dir\source\threads\async_lock.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/threads/async_lock.cpp
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++ -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj -MF CMakeFiles\\concurrencpp.dir\\source\\threads\\async_lock.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/threads/async_lock.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/threads/async_lock.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/local/concurrencpp-v.0.1.7/source/threads/async_lock.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?lock_impl@async_lock@concurrencpp@@AAE?AV?$lazy_result@Vscoped_async_lock@concurrencpp@@@2@V?$shared_ptr@Vexecutor@concurrencpp@@@std@@[email protected]"'
Exception Code: 0xE0000046
 #0 0x00007fff2500cd29 (C:\Windows\System32\KERNELBASE.dll+0x2cd29)
 #1 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2578fda C:\Program Files\LLVM\bin\clang++.exe 0x2579139
 #2 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x24730e3 C:\Program Files\LLVM\bin\clang++.exe 0x2589a29
 #3 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2404004 C:\Program Files\LLVM\bin\clang++.exe 0x222b0dd
 #4 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f92d43 C:\Program Files\LLVM\bin\clang++.exe 0x35eedb
 #5 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f765fb C:\Program Files\LLVM\bin\clang++.exe 0x1ed41cd
 #6 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ed268e C:\Program Files\LLVM\bin\clang++.exe 0x1ed13d3
 #7 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ecf16d C:\Program Files\LLVM\bin\clang++.exe 0x356c69
 #8 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1faab61 C:\Program Files\LLVM\bin\clang++.exe 0x1ec9b03
 #9 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x337451 C:\Program Files\LLVM\bin\clang++.exe 0x336f64
#10 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x331246 C:\Program Files\LLVM\bin\clang++.exe 0x1ec456e
#11 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2340013 C:\Program Files\LLVM\bin\clang++.exe 0x30497
#12 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2ff37 C:\Program Files\LLVM\bin\clang++.exe 0x2c82d
#13 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2b306 C:\Program Files\LLVM\bin\clang++.exe 0x29afe
#14 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1271fed C:\Program Files\LLVM\bin\clang++.exe 0x724f15
#15 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x724d18 C:\Program Files\LLVM\bin\clang++.exe 0x137258
#16 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x136c0c C:\Program Files\LLVM\bin\clang++.exe 0x136727
#17 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x12fb20 C:\Program Files\LLVM\bin\clang++.exe 0x12edb1
#18 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x23c68b0 (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)#19 0x00007ff614c58fda
#20 0x00007ff614c58fda (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)
0x00007FFF2500CD29, C:\Windows\System32\KERNELBASE.dll(0x00007FFF24FE0000) + 0x2CD29 byte(s), RaiseException() + 0x69 byte(s)
0x00007FF614C58FDA, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2578FDA byte(s)
0x00007FF614C59139, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2579139 byte(s)
0x00007FF614B530E3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x24730E3 byte(s)
0x00007FF614C69A29, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2589A29 byte(s)
0x00007FF614AE4004, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2404004 byte(s)
0x00007FF61490B0DD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x222B0DD byte(s)
0x00007FF614672D43, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F92D43 byte(s)
0x00007FF612A3EEDB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x35EEDB byte(s)
0x00007FF6146565FB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F765FB byte(s)
0x00007FF6145B41CD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED41CD byte(s)
0x00007FF6145B268E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED268E byte(s)
0x00007FF6145B13D3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED13D3 byte(s)
0x00007FF6145AF16D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ECF16D byte(s)
0x00007FF612A36C69, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x356C69 byte(s)
0x00007FF61468AB61, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1FAAB61 byte(s)
0x00007FF6145A9B03, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC9B03 byte(s)
0x00007FF612A17451, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x337451 byte(s)
0x00007FF612A16F64, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x336F64 byte(s)
0x00007FF612A11246, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x331246 byte(s)
0x00007FF6145A456E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC456E byte(s)
0x00007FF614A20013, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2340013 byte(s)
0x00007FF612710497, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x30497 byte(s)
0x00007FF61270FF37, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2FF37 byte(s)
0x00007FF61270C82D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2C82D byte(s)
0x00007FF61270B306, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2B306 byte(s)
0x00007FF612709AFE, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x29AFE byte(s)
0x00007FF613951FED, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1271FED byte(s)
0x00007FF612E04F15, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724F15 byte(s)
0x00007FF612E04D18, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724D18 byte(s)
0x00007FF612817258, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x137258 byte(s)
0x00007FF612816C0C, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136C0C byte(s)
0x00007FF612816727, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136727 byte(s)
0x00007FF61280FB20, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12FB20 byte(s)
0x00007FF61280EDB1, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12EDB1 byte(s)
0x00007FF614AA68B0, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x23C68B0 byte(s)
0x00007FFF26677614, C:\Windows\System32\KERNEL32.DLL(0x00007FFF26660000) + 0x17614 byte(s), BaseThreadInitThunk() + 0x14 byte(s)
0x00007FFF276C26A1, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFF27670000) + 0x526A1 byte(s), RtlUserThreadStart() + 0x21 byte(s)
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 17.0.5
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\async_lock-b0c2b2.cpp
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\async_lock-b0c2b2.sh
clang++: note: diagnostic msg:

********************
[14/16] Building CXX object CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj
FAILED: CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj
clang++  -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj -MF CMakeFiles\concurrencpp.dir\source\threads\async_condition_variable.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/threads/async_condition_variable.cpp
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++ -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj -MF CMakeFiles\\concurrencpp.dir\\source\\threads\\async_condition_variable.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/threads/async_condition_variable.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/threads/async_condition_variable.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/local/concurrencpp-v.0.1.7/source/threads/async_condition_variable.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?await_impl@async_condition_variable@concurrencpp@@AAE?AV?$lazy_result@X@2@V?$shared_ptr@Vexecutor@concurrencpp@@@std@@AAVscoped_async_lock@2@@Z.resume"'
Exception Code: 0xE0000046
 #0 0x00007fff2500cd29 (C:\Windows\System32\KERNELBASE.dll+0x2cd29)
 #1 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2578fda C:\Program Files\LLVM\bin\clang++.exe 0x2579139
 #2 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x24730e3 C:\Program Files\LLVM\bin\clang++.exe 0x2589a29
 #3 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2404004 C:\Program Files\LLVM\bin\clang++.exe 0x222b0dd
 #4 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f92d43 C:\Program Files\LLVM\bin\clang++.exe 0x35eedb
 #5 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f765fb C:\Program Files\LLVM\bin\clang++.exe 0x1ed41cd
 #6 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ed268e C:\Program Files\LLVM\bin\clang++.exe 0x1ed13d3
 #7 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ecf16d C:\Program Files\LLVM\bin\clang++.exe 0x356c69
 #8 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1faab61 C:\Program Files\LLVM\bin\clang++.exe 0x1ec9b03
 #9 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x337451 C:\Program Files\LLVM\bin\clang++.exe 0x336f64
#10 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x331246 C:\Program Files\LLVM\bin\clang++.exe 0x1ec456e
#11 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2340013 C:\Program Files\LLVM\bin\clang++.exe 0x30497
#12 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2ff37 C:\Program Files\LLVM\bin\clang++.exe 0x2c82d
#13 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2b306 C:\Program Files\LLVM\bin\clang++.exe 0x29afe
#14 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1271fed C:\Program Files\LLVM\bin\clang++.exe 0x724f15
#15 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x724d18 C:\Program Files\LLVM\bin\clang++.exe 0x137258
#16 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x136c0c C:\Program Files\LLVM\bin\clang++.exe 0x136727
#17 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x12fb20 C:\Program Files\LLVM\bin\clang++.exe 0x12edb1
#18 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x23c68b0 (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)#19 0x00007ff614c58fda
#20 0x00007ff614c58fda (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)
0x00007FFF2500CD29, C:\Windows\System32\KERNELBASE.dll(0x00007FFF24FE0000) + 0x2CD29 byte(s), RaiseException() + 0x69 byte(s)
0x00007FF614C58FDA, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2578FDA byte(s)
0x00007FF614C59139, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2579139 byte(s)
0x00007FF614B530E3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x24730E3 byte(s)
0x00007FF614C69A29, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2589A29 byte(s)
0x00007FF614AE4004, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2404004 byte(s)
0x00007FF61490B0DD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x222B0DD byte(s)
0x00007FF614672D43, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F92D43 byte(s)
0x00007FF612A3EEDB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x35EEDB byte(s)
0x00007FF6146565FB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F765FB byte(s)
0x00007FF6145B41CD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED41CD byte(s)
0x00007FF6145B268E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED268E byte(s)
0x00007FF6145B13D3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED13D3 byte(s)
0x00007FF6145AF16D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ECF16D byte(s)
0x00007FF612A36C69, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x356C69 byte(s)
0x00007FF61468AB61, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1FAAB61 byte(s)
0x00007FF6145A9B03, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC9B03 byte(s)
0x00007FF612A17451, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x337451 byte(s)
0x00007FF612A16F64, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x336F64 byte(s)
0x00007FF612A11246, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x331246 byte(s)
0x00007FF6145A456E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC456E byte(s)
0x00007FF614A20013, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2340013 byte(s)
0x00007FF612710497, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x30497 byte(s)
0x00007FF61270FF37, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2FF37 byte(s)
0x00007FF61270C82D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2C82D byte(s)
0x00007FF61270B306, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2B306 byte(s)
0x00007FF612709AFE, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x29AFE byte(s)
0x00007FF613951FED, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1271FED byte(s)
0x00007FF612E04F15, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724F15 byte(s)
0x00007FF612E04D18, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724D18 byte(s)
0x00007FF612817258, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x137258 byte(s)
0x00007FF612816C0C, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136C0C byte(s)
0x00007FF612816727, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136727 byte(s)
0x00007FF61280FB20, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12FB20 byte(s)
0x00007FF61280EDB1, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12EDB1 byte(s)
0x00007FF614AA68B0, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x23C68B0 byte(s)
0x00007FFF26677614, C:\Windows\System32\KERNEL32.DLL(0x00007FFF26660000) + 0x17614 byte(s), BaseThreadInitThunk() + 0x14 byte(s)
0x00007FFF276C26A1, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFF27670000) + 0x526A1 byte(s), RtlUserThreadStart() + 0x21 byte(s)
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 17.0.5
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\async_condition_variable-2a060d.cpp
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\async_condition_variable-2a060d.sh
clang++: note: diagnostic msg:

********************
[15/16] Building CXX object CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj
FAILED: CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj
clang++  -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj -MF CMakeFiles\concurrencpp.dir\source\timers\timer_queue.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/timers/timer_queue.cpp
fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++ -isystem C:/local/concurrencpp-v.0.1.7/include -m32 -O3 -DNDEBUG -std=c++20 -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -fvisibility-inlines-hidden -MD -MT CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj -MF CMakeFiles\\concurrencpp.dir\\source\\timers\\timer_queue.cpp.obj.d -o CMakeFiles/concurrencpp.dir/source/timers/timer_queue.cpp.obj -c C:/local/concurrencpp-v.0.1.7/source/timers/timer_queue.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'C:/local/concurrencpp-v.0.1.7/source/timers/timer_queue.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@"?make_delay_object_impl@timer_queue@concurrencpp@@AAE?AV?$lazy_result@X@2@V?$duration@_JU?$ratio@$00$0DOI@@std@@@chrono@std@@V?$shared_ptr@Vtimer_queue@concurrencpp@@@6@V?$shared_ptr@Vexecutor@concurrencpp@@@6@@Z.resume"'
Exception Code: 0xE0000046
 #0 0x00007fff2500cd29 (C:\Windows\System32\KERNELBASE.dll+0x2cd29)
 #1 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2578fda C:\Program Files\LLVM\bin\clang++.exe 0x2579139
 #2 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x24730e3 C:\Program Files\LLVM\bin\clang++.exe 0x2589a29
 #3 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2404004 C:\Program Files\LLVM\bin\clang++.exe 0x222b0dd
 #4 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f92d43 C:\Program Files\LLVM\bin\clang++.exe 0x35eedb
 #5 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1f765fb C:\Program Files\LLVM\bin\clang++.exe 0x1ed41cd
 #6 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ed268e C:\Program Files\LLVM\bin\clang++.exe 0x1ed13d3
 #7 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1ecf16d C:\Program Files\LLVM\bin\clang++.exe 0x356c69
 #8 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1faab61 C:\Program Files\LLVM\bin\clang++.exe 0x1ec9b03
 #9 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x337451 C:\Program Files\LLVM\bin\clang++.exe 0x336f64
#10 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x331246 C:\Program Files\LLVM\bin\clang++.exe 0x1ec456e
#11 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2340013 C:\Program Files\LLVM\bin\clang++.exe 0x30497
#12 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2ff37 C:\Program Files\LLVM\bin\clang++.exe 0x2c82d
#13 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x2b306 C:\Program Files\LLVM\bin\clang++.exe 0x29afe
#14 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x1271fed C:\Program Files\LLVM\bin\clang++.exe 0x724f15
#15 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x724d18 C:\Program Files\LLVM\bin\clang++.exe 0x137258
#16 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x136c0c C:\Program Files\LLVM\bin\clang++.exe 0x136727
#17 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x12fb20 C:\Program Files\LLVM\bin\clang++.exe 0x12edb1
#18 0x00007ff614c58fda C:\Program Files\LLVM\bin\clang++.exe 0x23c68b0 (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)#19 0x00007ff614c58fda
#20 0x00007ff614c58fda (C:\Program Files\LLVM\bin\clang++.exe+0x2578fda)
0x00007FFF2500CD29, C:\Windows\System32\KERNELBASE.dll(0x00007FFF24FE0000) + 0x2CD29 byte(s), RaiseException() + 0x69 byte(s)
0x00007FF614C58FDA, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2578FDA byte(s)
0x00007FF614C59139, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2579139 byte(s)
0x00007FF614B530E3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x24730E3 byte(s)
0x00007FF614C69A29, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2589A29 byte(s)
0x00007FF614AE4004, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2404004 byte(s)
0x00007FF61490B0DD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x222B0DD byte(s)
0x00007FF614672D43, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F92D43 byte(s)
0x00007FF612A3EEDB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x35EEDB byte(s)
0x00007FF6146565FB, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1F765FB byte(s)
0x00007FF6145B41CD, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED41CD byte(s)
0x00007FF6145B268E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED268E byte(s)
0x00007FF6145B13D3, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ED13D3 byte(s)
0x00007FF6145AF16D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1ECF16D byte(s)
0x00007FF612A36C69, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x356C69 byte(s)
0x00007FF61468AB61, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1FAAB61 byte(s)
0x00007FF6145A9B03, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC9B03 byte(s)
0x00007FF612A17451, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x337451 byte(s)
0x00007FF612A16F64, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x336F64 byte(s)
0x00007FF612A11246, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x331246 byte(s)
0x00007FF6145A456E, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1EC456E byte(s)
0x00007FF614A20013, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2340013 byte(s)
0x00007FF612710497, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x30497 byte(s)
0x00007FF61270FF37, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2FF37 byte(s)
0x00007FF61270C82D, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2C82D byte(s)
0x00007FF61270B306, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x2B306 byte(s)
0x00007FF612709AFE, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x29AFE byte(s)
0x00007FF613951FED, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x1271FED byte(s)
0x00007FF612E04F15, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724F15 byte(s)
0x00007FF612E04D18, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x724D18 byte(s)
0x00007FF612817258, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x137258 byte(s)
0x00007FF612816C0C, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136C0C byte(s)
0x00007FF612816727, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x136727 byte(s)
0x00007FF61280FB20, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12FB20 byte(s)
0x00007FF61280EDB1, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x12EDB1 byte(s)
0x00007FF614AA68B0, C:\Program Files\LLVM\bin\clang++.exe(0x00007FF6126E0000) + 0x23C68B0 byte(s)
0x00007FFF26677614, C:\Windows\System32\KERNEL32.DLL(0x00007FFF26660000) + 0x17614 byte(s), BaseThreadInitThunk() + 0x14 byte(s)
0x00007FFF276C26A1, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFF27670000) + 0x526A1 byte(s), RtlUserThreadStart() + 0x21 byte(s)
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 17.0.5
Target: i386-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
clang++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\timer_queue-1b9c15.cpp
clang++: note: diagnostic msg: C:\Users\admin\AppData\Local\Temp\timer_queue-1b9c15.sh
clang++: note: diagnostic msg:

********************
ninja: build stopped: subcommand failed.

Here is the log of an attempt to compile my main.cpp file using the cppcoro header files:

1>fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
1>PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
1>Stack dump:
1>0.	Program arguments: "C:\\Program Files\\LLVM19\\bin\\clang-cl.exe" @C:\\Users\\admin\\AppData\\Local\\Temp\\MSBuildTempadmin\\tmp179bb6e9fba3428297c5e442b8c5100c.rsp
1>1.	<eof> parser at end of file
1>2.	Code generation
1>3.	Running pass 'Function Pass Manager' on module 'main.cpp'.
1>4.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@"??$make_sync_wait_task@AAV?$task@X@cppcoro@@X$0A@@detail@cppcoro@@YA?AV?$sync_wait_task@X@01@AAV?$task@X@1@@Z.resume"'
1>Exception Code: 0xE0000046
1> #0 0x00007fff2500cd29 (C:\Windows\System32\KERNELBASE.dll+0x2cd29)
1> #1 0x00007ff696abcf5a (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1e2cf5a)
1> #2 0x00007ff696abd0d9 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1e2d0d9)
1> #3 0x00007ff6969b8713 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1d28713)
1> #4 0x00007ff696ad0173 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1e40173)
1> #5 0x00007ff696914184 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1c84184)
1> #6 0x00007ff696690b11 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1a00b11)
1> #7 0x00007ff69647deda (C:\Program Files\LLVM19\bin\clang-cl.exe+0x17ededa)
1> #8 0x00007ff69646c64c (C:\Program Files\LLVM19\bin\clang-cl.exe+0x17dc64c)
1> #9 0x00007ff69646b594 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x17db594)
1>#10 0x00007ff6963ae114 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x171e114)
1>#11 0x00007ff69639ad49 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x170ad49)
1>#12 0x00007ff69639964d (C:\Program Files\LLVM19\bin\clang-cl.exe+0x170964d)
1>#13 0x00007ff6963879ac (C:\Program Files\LLVM19\bin\clang-cl.exe+0x16f79ac)
1>#14 0x00007ff694faf419 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x31f419)
1>#15 0x00007ff6950c0ce1 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x430ce1)
1>#16 0x00007ff69631da21 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x168da21)
1>#17 0x00007ff6963085c1 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x16785c1)
1>#18 0x00007ff694f655a1 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x2d55a1)
1>#19 0x00007ff694f64f47 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x2d4f47)
1>#20 0x00007ff694f5e6ec (C:\Program Files\LLVM19\bin\clang-cl.exe+0x2ce6ec)
1>#21 0x00007ff696302eea (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1672eea)
1>#22 0x00007ff6967f0818 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1b60818)
1>#23 0x00007ff695254091 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x5c4091)
1>#24 0x00007ff695253c22 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x5c3c22)
1>#25 0x00007ff695250996 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x5c0996)
1>#26 0x00007ff69524d955 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x5bd955)
1>#27 0x00007ff69524c2ee (C:\Program Files\LLVM19\bin\clang-cl.exe+0x5bc2ee)
1>#28 0x00007ff69596549d (C:\Program Files\LLVM19\bin\clang-cl.exe+0xcd549d)
1>#29 0x00007ff6953d4215 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x744215)
1>#30 0x00007ff6953d4008 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x744008)
1>#31 0x00007ff6950dc518 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x44c518)
1>#32 0x00007ff6950db89e (C:\Program Files\LLVM19\bin\clang-cl.exe+0x44b89e)
1>#33 0x00007ff6950db417 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x44b417)
1>#34 0x00007ff6950d2ba6 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x442ba6)
1>#35 0x00007ff6950d0323 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x440323)
1>#36 0x00007ff696892db8 (C:\Program Files\LLVM19\bin\clang-cl.exe+0x1c02db8)
1>#37 0x00007fff26677614 (C:\Windows\System32\KERNEL32.DLL+0x17614)
1>#38 0x00007fff276c26a1 (C:\Windows\SYSTEM32\ntdll.dll+0x526a1)
1>clang-cl : error : clang frontend command failed with exit code 70 (use -v to see invocation)
1>clang version 19.1.5
1>Target: i386-pc-windows-msvc
1>Thread model: posix
1>InstalledDir: C:\Program Files\LLVM19\bin
1>clang-cl : message : diagnostic msg:
1>********************
1>PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
1>Preprocessed source(s) and associated run script(s) are located at:
1>clang-cl : message : diagnostic msg: C:\Users\admin\AppData\Local\Temp\main-3b45b0.cpp
1>clang-cl : message : diagnostic msg: C:\Users\admin\AppData\Local\Temp\main-3b45b0.sh
1>clang-cl : message : diagnostic msg:
1>********************

Here are the contents of the main.cpp file:

#include <cppcoro/coroutine.hpp>
#include <cppcoro/task.hpp>
#include <cppcoro/static_thread_pool.hpp>
#include <cppcoro/schedule_on.hpp>
#include <cppcoro/resume_on.hpp>
#include <cppcoro/sync_wait.hpp>

#include <iostream>

cppcoro::task<void> task(cppcoro::static_thread_pool& tp) {
	co_await tp.schedule();
	//std::cout << "123" << std::endl;
	co_return;
}

int main() {
	cppcoro::static_thread_pool tp;
	auto ts = task(tp);
	cppcoro::sync_wait(ts);
	return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions