llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.34k stars 11.7k forks source link

Crash cross-compiling with clang-cl for Windows ARM #83450

Open Mr-Clam opened 7 months ago

Mr-Clam commented 7 months ago

I'm seeing a crash that affects LLVM 17 and 18, cross compiling on Ubuntu 22.04 for Windows ARM via clang-cl. Headers are coming from the Windows 10 SDK and from Visual Studio 2022 17.4.

I've reduced the code down to the simplest case I can, and this source is attached, along with the bug report files. Commenting out any of the std::vectors or the line towards the end containing emplace_back avoids the crash. Removing any of these three command line parameters also avoids the crash: /EHa /clang:-O3 /Zi. I get no warnings either for -Wall -Wpedantic nor from clang-tidy.

llvm17_crash.cpp.txt llvm17_crash-d5b7e4.cpp.txt llvm17_crash-d5b7e4.sh.txt

Terminal output:

# clang-cl -v "--target=aarch64-windows-msvc" "-imsvc" "/opt/ms/MSVC/14.34.31933/include" "-imsvc" "/opt/ms/winsdk/Include/10.0.19041.0/ucrt"  /EHa /clang:-O3 /Zi -std:c++17 /showIncludes /Fo/tmp/llvm17_crash.cpp.obj /Fd/tmp/llvm17_crash.pdb -c -- /root/workdir/llvm17_crash.cpp
clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
Target: aarch64-unknown-windows-msvc
Thread model: posix
InstalledDir: /usr/bin
 (in-process)
 "/opt/llvm-17/bin/clang-17" -cc1 -triple aarch64-unknown-windows-msvc19.20.0 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name llvm17_crash.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-abi aapcs -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames --show-includes -sys-header-deps -stack-protector 2 -fcxx-exceptions -fexceptions -fasync-exceptions -fdiagnostics-format msvc -gno-column-info -gcodeview -debug-info-kind=constructor -v -fcoverage-compilation-dir=/root/workdir -resource-dir /opt/llvm-17/lib/clang/17 -internal-isystem /opt/llvm-17/lib/clang/17/include -internal-isystem /opt/ms/MSVC/14.34.31933/include -internal-isystem /opt/ms/winsdk/Include/10.0.19041.0/ucrt -O3 -fdeprecated-macro -fdebug-compilation-dir=/root/workdir -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.20 -std=c++17 -fdelayed-template-parsing -fcolor-diagnostics -vectorize-loops -vectorize-slp -target-feature -fmv -faddrsig -object-file-name=/tmp/llvm17_crash.cpp.obj -o /tmp/llvm17_crash.cpp.obj -x c++ /root/workdir/llvm17_crash.cpp
clang -cc1 version 17.0.6 based upon LLVM 17.0.6 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /opt/llvm-17/lib/clang/17/include
 /opt/ms/MSVC/14.34.31933/include
 /opt/ms/winsdk/Include/10.0.19041.0/ucrt
End of search list.
Note: including file: /opt/ms/MSVC/14.34.31933/include/vector
Note: including file:  /opt/ms/MSVC/14.34.31933/include/yvals_core.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/vcruntime.h
Note: including file:    /opt/ms/MSVC/14.34.31933/include/sal.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/concurrencysal.h
Note: including file:    /opt/llvm-17/lib/clang/17/include/vadefs.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/vadefs.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/xkeycheck.h
Note: including file:  /opt/ms/MSVC/14.34.31933/include/xmemory
Note: including file:   /opt/ms/MSVC/14.34.31933/include/cstdint
Note: including file:    /opt/llvm-17/lib/clang/17/include/stdint.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/stdint.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/cstdlib
Note: including file:    /opt/ms/winsdk/Include/10.0.19041.0/ucrt/math.h
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_math.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt.h
Note: including file:    /opt/ms/winsdk/Include/10.0.19041.0/ucrt/stdlib.h
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_malloc.h
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_search.h
Note: including file:      /opt/llvm-17/lib/clang/17/include/stddef.h
Note: including file:       /opt/llvm-17/lib/clang/17/include/__stddef_max_align_t.h
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstdlib.h
Note: including file:     /opt/llvm-17/lib/clang/17/include/limits.h
Note: including file:      /opt/ms/MSVC/14.34.31933/include/limits.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/limits
Note: including file:    /opt/ms/MSVC/14.34.31933/include/cfloat
Note: including file:     /opt/llvm-17/lib/clang/17/include/float.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/float.h
Note: including file:    /opt/ms/MSVC/14.34.31933/include/climits
Note: including file:    /opt/ms/MSVC/14.34.31933/include/cwchar
Note: including file:     /opt/ms/MSVC/14.34.31933/include/cstdio
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/stdio.h
Note: including file:       /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstdio.h
Note: including file:        /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_stdio_config.h
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/wchar.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_memcpy_s.h
Note: including file:       /opt/ms/winsdk/Include/10.0.19041.0/ucrt/errno.h
Note: including file:       /opt/ms/MSVC/14.34.31933/include/vcruntime_string.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wconio.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wctype.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wdirect.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wio.h
Note: including file:       /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_share.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wprocess.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstring.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wtime.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/sys/stat.h
Note: including file:       /opt/ms/winsdk/Include/10.0.19041.0/ucrt/sys/types.h
Note: including file:    /opt/ms/MSVC/14.34.31933/include/intrin0.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/intrin0.inl.h
Note: including file:    /opt/ms/MSVC/14.34.31933/include/isa_availability.h
Note: including file:    /opt/ms/MSVC/14.34.31933/include/xstddef
Note: including file:     /opt/ms/MSVC/14.34.31933/include/cstddef
Note: including file:      /opt/llvm-17/lib/clang/17/include/stddef.h
Note: including file:      /opt/ms/MSVC/14.34.31933/include/xtr1common
Note: including file:     /opt/ms/MSVC/14.34.31933/include/initializer_list
Note: including file:   /opt/ms/MSVC/14.34.31933/include/new
Note: including file:    /opt/ms/MSVC/14.34.31933/include/exception
Note: including file:     /opt/ms/MSVC/14.34.31933/include/yvals.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/crtdbg.h
Note: including file:       /opt/ms/MSVC/14.34.31933/include/vcruntime_new_debug.h
Note: including file:        /opt/ms/MSVC/14.34.31933/include/vcruntime_new.h
Note: including file:      /opt/ms/MSVC/14.34.31933/include/crtdefs.h
Note: including file:      /opt/ms/MSVC/14.34.31933/include/use_ansi.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/type_traits
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/malloc.h
Note: including file:     /opt/ms/MSVC/14.34.31933/include/vcruntime_exception.h
Note: including file:      /opt/ms/MSVC/14.34.31933/include/eh.h
Note: including file:       /opt/llvm-17/lib/clang/17/include/vadefs.h
Note: including file:       /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_terminate.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/xatomic.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/xutility
Note: including file:    /opt/ms/MSVC/14.34.31933/include/__msvc_iter_core.hpp
Note: including file:     /opt/ms/MSVC/14.34.31933/include/utility
Note: including file:    /opt/ms/MSVC/14.34.31933/include/cstring
Note: including file:     /opt/ms/winsdk/Include/10.0.19041.0/ucrt/string.h
Note: including file:      /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_memory.h
Note: including file:  /opt/ms/MSVC/14.34.31933/include/xpolymorphic_allocator.h
Note: including file:   /opt/ms/MSVC/14.34.31933/include/tuple
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-cl -v --target=aarch64-windows-msvc -imsvc /opt/ms/MSVC/14.34.31933/include -imsvc /opt/ms/winsdk/Include/10.0.19041.0/ucrt /EHa /clang:-O3 /Zi -std:c++17 /showIncludes /Fo/tmp/llvm17_crash.cpp.obj /Fd/tmp/llvm17_crash.pdb -c -- /root/workdir/llvm17_crash.cpp
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module '/root/workdir/llvm17_crash.cpp'.
4.  Running pass 'AArch64 Instruction Selection' on function '@"??$_Destroy_range@V?$allocator@Uinfo1_t@C2@NS2@@@std@@@std@@YAXPEAUinfo1_t@C2@NS2@@QEAU123@AEAV?$allocator@Uinfo1_t@C2@NS2@@@0@@Z"'
 #0 0x00005626fe2d78b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/llvm-17/bin/clang-17+0x2bbf8b8)
 #1 0x00005626fe2d586e llvm::sys::RunSignalHandlers() (/opt/llvm-17/bin/clang-17+0x2bbd86e)
 #2 0x00005626fe255529 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f1500d0b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00005626fefedd15 llvm::SelectionDAGISel::reportIPToStateForBlocks(llvm::MachineFunction*) (/opt/llvm-17/bin/clang-17+0x38d5d15)
 #5 0x00005626fefebf88 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/llvm-17/bin/clang-17+0x38d3f88)
 #6 0x00005626fefe98c9 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/llvm-17/bin/clang-17+0x38d18c9)
 #7 0x00005626fd9f119f llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/llvm-17/bin/clang-17+0x22d919f)
 #8 0x00005626fde032f6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/llvm-17/bin/clang-17+0x26eb2f6)
 #9 0x00005626fde0a513 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/llvm-17/bin/clang-17+0x26f2513)
#10 0x00005626fde03f0a llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/llvm-17/bin/clang-17+0x26ebf0a)
#11 0x00005626fe472805 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/llvm-17/bin/clang-17+0x2d5a805)
#12 0x00005626ff0ea6f0 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/llvm-17/bin/clang-17+0x39d26f0)
#13 0x00005627000d8e56 clang::ParseAST(clang::Sema&, bool, bool) (/opt/llvm-17/bin/clang-17+0x49c0e56)
#14 0x00005626feb3db17 clang::FrontendAction::Execute() (/opt/llvm-17/bin/clang-17+0x3425b17)
#15 0x00005626feab1024 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/llvm-17/bin/clang-17+0x3399024)
#16 0x00005626febf4fdf clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/llvm-17/bin/clang-17+0x34dcfdf)
#17 0x00005626fc4f7342 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/llvm-17/bin/clang-17+0xddf342)
#18 0x00005626fc4f4df1 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#19 0x00005626fe91ca59 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0
#20 0x00005626fe25530c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/llvm-17/bin/clang-17+0x2b3d30c)
#21 0x00005626fe91c466 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/opt/llvm-17/bin/clang-17+0x3204466)
#22 0x00005626fe8df4dc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/llvm-17/bin/clang-17+0x31c74dc)
#23 0x00005626fe8df97e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/llvm-17/bin/clang-17+0x31c797e)
#24 0x00005626fe8fcfc0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/llvm-17/bin/clang-17+0x31e4fc0)
#25 0x00005626fc4f448d clang_main(int, char**, llvm::ToolContext const&) (/opt/llvm-17/bin/clang-17+0xddc48d)
#26 0x00005626fc502061 main (/opt/llvm-17/bin/clang-17+0xdea061)
#27 0x00007f1500cf2d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#28 0x00007f1500cf2e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#29 0x00005626fc4f1515 _start (/opt/llvm-17/bin/clang-17+0xdd9515)
clang-cl: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
Target: aarch64-unknown-windows-msvc
Thread model: posix
InstalledDir: /usr/bin
clang-cl: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-cl: note: diagnostic msg: /tmp/llvm17_crash-d5b7e4.cpp
clang-cl: note: diagnostic msg: /tmp/llvm17_crash-d5b7e4.sh
clang-cl: note: diagnostic msg: 

********************
llvmbot commented 7 months ago

@llvm/issue-subscribers-backend-aarch64

Author: None (Mr-Clam)

I'm seeing a crash that affects LLVM 17 and 18, cross compiling on Ubuntu 22.04 for Windows ARM via clang-cl. Headers are coming from the Windows 10 SDK and from Visual Studio 2022 17.4. I've reduced the code down to the simplest case I can, and this source is attached, along with the bug report files. Commenting out any of the `std::vectors` or the line towards the end containing `emplace_back` avoids the crash. Removing any of these three command line parameters also avoids the crash: `/EHa /clang:-O3 /Zi`. I get no warnings either for `-Wall -Wpedantic` nor from `clang-tidy`. [llvm17_crash.cpp.txt](https://github.com/llvm/llvm-project/files/14451544/llvm17_crash.cpp.txt) [llvm17_crash-d5b7e4.cpp.txt](https://github.com/llvm/llvm-project/files/14451542/llvm17_crash-d5b7e4.cpp.txt) [llvm17_crash-d5b7e4.sh.txt](https://github.com/llvm/llvm-project/files/14451543/llvm17_crash-d5b7e4.sh.txt) Terminal output: ``` # clang-cl -v "--target=aarch64-windows-msvc" "-imsvc" "/opt/ms/MSVC/14.34.31933/include" "-imsvc" "/opt/ms/winsdk/Include/10.0.19041.0/ucrt" /EHa /clang:-O3 /Zi -std:c++17 /showIncludes /Fo/tmp/llvm17_crash.cpp.obj /Fd/tmp/llvm17_crash.pdb -c -- /root/workdir/llvm17_crash.cpp clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: aarch64-unknown-windows-msvc Thread model: posix InstalledDir: /usr/bin (in-process) "/opt/llvm-17/bin/clang-17" -cc1 -triple aarch64-unknown-windows-msvc19.20.0 -emit-obj -mincremental-linker-compatible -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name llvm17_crash.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu generic -target-feature +neon -target-feature +v8a -target-abi aapcs -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames --show-includes -sys-header-deps -stack-protector 2 -fcxx-exceptions -fexceptions -fasync-exceptions -fdiagnostics-format msvc -gno-column-info -gcodeview -debug-info-kind=constructor -v -fcoverage-compilation-dir=/root/workdir -resource-dir /opt/llvm-17/lib/clang/17 -internal-isystem /opt/llvm-17/lib/clang/17/include -internal-isystem /opt/ms/MSVC/14.34.31933/include -internal-isystem /opt/ms/winsdk/Include/10.0.19041.0/ucrt -O3 -fdeprecated-macro -fdebug-compilation-dir=/root/workdir -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.20 -std=c++17 -fdelayed-template-parsing -fcolor-diagnostics -vectorize-loops -vectorize-slp -target-feature -fmv -faddrsig -object-file-name=/tmp/llvm17_crash.cpp.obj -o /tmp/llvm17_crash.cpp.obj -x c++ /root/workdir/llvm17_crash.cpp clang -cc1 version 17.0.6 based upon LLVM 17.0.6 default target x86_64-unknown-linux-gnu #include "..." search starts here: #include <...> search starts here: /opt/llvm-17/lib/clang/17/include /opt/ms/MSVC/14.34.31933/include /opt/ms/winsdk/Include/10.0.19041.0/ucrt End of search list. Note: including file: /opt/ms/MSVC/14.34.31933/include/vector Note: including file: /opt/ms/MSVC/14.34.31933/include/yvals_core.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vcruntime.h Note: including file: /opt/ms/MSVC/14.34.31933/include/sal.h Note: including file: /opt/ms/MSVC/14.34.31933/include/concurrencysal.h Note: including file: /opt/llvm-17/lib/clang/17/include/vadefs.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vadefs.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xkeycheck.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xmemory Note: including file: /opt/ms/MSVC/14.34.31933/include/cstdint Note: including file: /opt/llvm-17/lib/clang/17/include/stdint.h Note: including file: /opt/ms/MSVC/14.34.31933/include/stdint.h Note: including file: /opt/ms/MSVC/14.34.31933/include/cstdlib Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/math.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_math.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/stdlib.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_malloc.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_search.h Note: including file: /opt/llvm-17/lib/clang/17/include/stddef.h Note: including file: /opt/llvm-17/lib/clang/17/include/__stddef_max_align_t.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstdlib.h Note: including file: /opt/llvm-17/lib/clang/17/include/limits.h Note: including file: /opt/ms/MSVC/14.34.31933/include/limits.h Note: including file: /opt/ms/MSVC/14.34.31933/include/limits Note: including file: /opt/ms/MSVC/14.34.31933/include/cfloat Note: including file: /opt/llvm-17/lib/clang/17/include/float.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/float.h Note: including file: /opt/ms/MSVC/14.34.31933/include/climits Note: including file: /opt/ms/MSVC/14.34.31933/include/cwchar Note: including file: /opt/ms/MSVC/14.34.31933/include/cstdio Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/stdio.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstdio.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_stdio_config.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/wchar.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_memcpy_s.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/errno.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vcruntime_string.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wconio.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wctype.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wdirect.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wio.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_share.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wprocess.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wstring.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_wtime.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/sys/stat.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/sys/types.h Note: including file: /opt/ms/MSVC/14.34.31933/include/intrin0.h Note: including file: /opt/ms/MSVC/14.34.31933/include/intrin0.inl.h Note: including file: /opt/ms/MSVC/14.34.31933/include/isa_availability.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xstddef Note: including file: /opt/ms/MSVC/14.34.31933/include/cstddef Note: including file: /opt/llvm-17/lib/clang/17/include/stddef.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xtr1common Note: including file: /opt/ms/MSVC/14.34.31933/include/initializer_list Note: including file: /opt/ms/MSVC/14.34.31933/include/new Note: including file: /opt/ms/MSVC/14.34.31933/include/exception Note: including file: /opt/ms/MSVC/14.34.31933/include/yvals.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/crtdbg.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vcruntime_new_debug.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vcruntime_new.h Note: including file: /opt/ms/MSVC/14.34.31933/include/crtdefs.h Note: including file: /opt/ms/MSVC/14.34.31933/include/use_ansi.h Note: including file: /opt/ms/MSVC/14.34.31933/include/type_traits Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/malloc.h Note: including file: /opt/ms/MSVC/14.34.31933/include/vcruntime_exception.h Note: including file: /opt/ms/MSVC/14.34.31933/include/eh.h Note: including file: /opt/llvm-17/lib/clang/17/include/vadefs.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_terminate.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xatomic.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xutility Note: including file: /opt/ms/MSVC/14.34.31933/include/__msvc_iter_core.hpp Note: including file: /opt/ms/MSVC/14.34.31933/include/utility Note: including file: /opt/ms/MSVC/14.34.31933/include/cstring Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/string.h Note: including file: /opt/ms/winsdk/Include/10.0.19041.0/ucrt/corecrt_memory.h Note: including file: /opt/ms/MSVC/14.34.31933/include/xpolymorphic_allocator.h Note: including file: /opt/ms/MSVC/14.34.31933/include/tuple 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-cl -v --target=aarch64-windows-msvc -imsvc /opt/ms/MSVC/14.34.31933/include -imsvc /opt/ms/winsdk/Include/10.0.19041.0/ucrt /EHa /clang:-O3 /Zi -std:c++17 /showIncludes /Fo/tmp/llvm17_crash.cpp.obj /Fd/tmp/llvm17_crash.pdb -c -- /root/workdir/llvm17_crash.cpp 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/root/workdir/llvm17_crash.cpp'. 4. Running pass 'AArch64 Instruction Selection' on function '@"??$_Destroy_range@V?$allocator@Uinfo1_t@C2@NS2@@@std@@@std@@YAXPEAUinfo1_t@C2@NS2@@QEAU123@AEAV?$allocator@Uinfo1_t@C2@NS2@@@0@@Z"' #0 0x00005626fe2d78b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/llvm-17/bin/clang-17+0x2bbf8b8) #1 0x00005626fe2d586e llvm::sys::RunSignalHandlers() (/opt/llvm-17/bin/clang-17+0x2bbd86e) #2 0x00005626fe255529 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0 #3 0x00007f1500d0b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) #4 0x00005626fefedd15 llvm::SelectionDAGISel::reportIPToStateForBlocks(llvm::MachineFunction*) (/opt/llvm-17/bin/clang-17+0x38d5d15) #5 0x00005626fefebf88 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/llvm-17/bin/clang-17+0x38d3f88) #6 0x00005626fefe98c9 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/llvm-17/bin/clang-17+0x38d18c9) #7 0x00005626fd9f119f llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/llvm-17/bin/clang-17+0x22d919f) #8 0x00005626fde032f6 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/llvm-17/bin/clang-17+0x26eb2f6) #9 0x00005626fde0a513 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/llvm-17/bin/clang-17+0x26f2513) #10 0x00005626fde03f0a llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/llvm-17/bin/clang-17+0x26ebf0a) #11 0x00005626fe472805 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) (/opt/llvm-17/bin/clang-17+0x2d5a805) #12 0x00005626ff0ea6f0 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/llvm-17/bin/clang-17+0x39d26f0) #13 0x00005627000d8e56 clang::ParseAST(clang::Sema&, bool, bool) (/opt/llvm-17/bin/clang-17+0x49c0e56) #14 0x00005626feb3db17 clang::FrontendAction::Execute() (/opt/llvm-17/bin/clang-17+0x3425b17) #15 0x00005626feab1024 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/llvm-17/bin/clang-17+0x3399024) #16 0x00005626febf4fdf clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/llvm-17/bin/clang-17+0x34dcfdf) #17 0x00005626fc4f7342 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/llvm-17/bin/clang-17+0xddf342) #18 0x00005626fc4f4df1 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0 #19 0x00005626fe91ca59 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) Job.cpp:0:0 #20 0x00005626fe25530c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/llvm-17/bin/clang-17+0x2b3d30c) #21 0x00005626fe91c466 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/opt/llvm-17/bin/clang-17+0x3204466) #22 0x00005626fe8df4dc clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/llvm-17/bin/clang-17+0x31c74dc) #23 0x00005626fe8df97e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/llvm-17/bin/clang-17+0x31c797e) #24 0x00005626fe8fcfc0 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/llvm-17/bin/clang-17+0x31e4fc0) #25 0x00005626fc4f448d clang_main(int, char**, llvm::ToolContext const&) (/opt/llvm-17/bin/clang-17+0xddc48d) #26 0x00005626fc502061 main (/opt/llvm-17/bin/clang-17+0xdea061) #27 0x00007f1500cf2d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90) #28 0x00007f1500cf2e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40) #29 0x00005626fc4f1515 _start (/opt/llvm-17/bin/clang-17+0xdd9515) clang-cl: error: clang frontend command failed with exit code 139 (use -v to see invocation) clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) Target: aarch64-unknown-windows-msvc Thread model: posix InstalledDir: /usr/bin clang-cl: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-cl: note: diagnostic msg: /tmp/llvm17_crash-d5b7e4.cpp clang-cl: note: diagnostic msg: /tmp/llvm17_crash-d5b7e4.sh clang-cl: note: diagnostic msg: ******************** ```