llvm / llvm-project

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

ICE on valid code during LLVM IR generation #84087

Closed ericniebler closed 4 months ago

ericniebler commented 7 months ago
[build] [1/2  50% :: 2.757] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp
[build] FAILED: examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o 
[build] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp
[build] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
[build] Stack dump:
[build] 0.  Program arguments: /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp
[build] 1.  <eof> parser at end of file
[build] 2.  Per-file LLVM IR generation
[build] 3.  /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:464:7: Generating code for declaration 'stdexec::__detail::__captures'
[build]  #0 0x00007f71e7ecc406 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xccc406)
[build]  #1 0x00007f71e7eca5b0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xcca5b0)
[build]  #2 0x00007f71e7e20d70 (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20d70)
[build]  #3 0x00007f71e6a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
[build]  #4 0x00007f71e7fe6943 llvm::Instruction::eraseFromParent() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xde6943)
[build]  #5 0x00007f71f05e5df0 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be5df0)
[build]  #6 0x00007f71f05e74cd (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be74cd)
[build]  #7 0x00007f71f05db2bf clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1bdb2bf)
[build]  #8 0x00007f71f071383a clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1383a)
[build]  #9 0x00007f71f071bb6c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1bb6c)
[build] #10 0x00007f71f0774c0a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d74c0a)
[build] #11 0x00007f71f0775884 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d75884)
[build] #12 0x00007f71f0795549 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d95549)
[build] #13 0x00007f71f078ed78 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d8ed78)
[build] #14 0x00007f71f07827b3 clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827b3)
[build] #15 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf)
[build] #16 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf)
[build] #17 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf)
[build] #18 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf)
[build] #19 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf)
[build] #20 0x00007f71f07808bb clang::CodeGen::CodeGenModule::Release() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d808bb)
[build] #21 0x00007f71f0828118 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1e28118)
[build] #22 0x00007f71f076b420 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d6b420)
[build] #23 0x00007f71ef437816 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0xa37816)
[build] #24 0x00007f71f11570c5 clang::FrontendAction::Execute() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27570c5)
[build] #25 0x00007f71f10d26c4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x26d26c4)
[build] #26 0x00007f71f11d0e84 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27d0e84)
[build] #27 0x000055b2959bd856 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang++-17+0x12856)
[build] #28 0x000055b2959bb3c5 (/usr/bin/clang++-17+0x103c5)
[build] #29 0x00007f71f0d94c59 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x2394c59)
[build] #30 0x00007f71e7e20b0c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20b0c)
[build] #31 0x00007f71f0d9449e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x239449e)
[build] #32 0x00007f71f0d5d40d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d40d)
[build] #33 0x00007f71f0d5d66e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d66e)
[build] #34 0x00007f71f0d791ed clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x23791ed)
[build] #35 0x000055b2959bad2d clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang++-17+0xfd2d)
[build] #36 0x000055b2959c7562 main (/usr/bin/clang++-17+0x1c562)
[build] #37 0x00007f71e6a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
[build] #38 0x00007f71e6a29e40 call_init ./csu/../csu/libc-start.c:128:20
[build] #39 0x00007f71e6a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
[build] #40 0x000055b2959b7df5 _start (/usr/bin/clang++-17+0xcdf5)
[build] clang++-17: error: clang frontend command failed with exit code 139 (use -v to see invocation)
[build] Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
[build] Target: x86_64-pc-linux-gnu
[build] Thread model: posix
[build] InstalledDir: /usr/bin
[build] clang++-17: note: diagnostic msg: 
[build] ********************
[build] 
[build] PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
[build] Preprocessed source(s) and associated run script(s) are located at:
[build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.cpp
[build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.sh
[build] clang++-17: note: diagnostic msg: 
[build] 
[build] ********************
ericniebler commented 7 months ago

hello_world.zip

llvmbot commented 7 months ago

@llvm/issue-subscribers-clang-codegen

Author: Eric Niebler (ericniebler)

``` [build] [1/2 50% :: 2.757] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] FAILED: examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o [build] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. [build] Stack dump: [build] 0. Program arguments: /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] 1. <eof> parser at end of file [build] 2. Per-file LLVM IR generation [build] 3. /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:464:7: Generating code for declaration 'stdexec::__detail::__captures' [build] #0 0x00007f71e7ecc406 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xccc406) [build] #1 0x00007f71e7eca5b0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xcca5b0) [build] #2 0x00007f71e7e20d70 (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20d70) [build] #3 0x00007f71e6a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) [build] #4 0x00007f71e7fe6943 llvm::Instruction::eraseFromParent() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xde6943) [build] #5 0x00007f71f05e5df0 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be5df0) [build] #6 0x00007f71f05e74cd (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be74cd) [build] #7 0x00007f71f05db2bf clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1bdb2bf) [build] #8 0x00007f71f071383a clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1383a) [build] #9 0x00007f71f071bb6c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1bb6c) [build] #10 0x00007f71f0774c0a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d74c0a) [build] #11 0x00007f71f0775884 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d75884) [build] #12 0x00007f71f0795549 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d95549) [build] #13 0x00007f71f078ed78 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d8ed78) [build] #14 0x00007f71f07827b3 clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827b3) [build] #15 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #16 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #17 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #18 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #19 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #20 0x00007f71f07808bb clang::CodeGen::CodeGenModule::Release() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d808bb) [build] #21 0x00007f71f0828118 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1e28118) [build] #22 0x00007f71f076b420 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d6b420) [build] #23 0x00007f71ef437816 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0xa37816) [build] #24 0x00007f71f11570c5 clang::FrontendAction::Execute() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27570c5) [build] #25 0x00007f71f10d26c4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x26d26c4) [build] #26 0x00007f71f11d0e84 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27d0e84) [build] #27 0x000055b2959bd856 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang++-17+0x12856) [build] #28 0x000055b2959bb3c5 (/usr/bin/clang++-17+0x103c5) [build] #29 0x00007f71f0d94c59 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x2394c59) [build] #30 0x00007f71e7e20b0c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20b0c) [build] #31 0x00007f71f0d9449e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x239449e) [build] #32 0x00007f71f0d5d40d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d40d) [build] #33 0x00007f71f0d5d66e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d66e) [build] #34 0x00007f71f0d791ed clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x23791ed) [build] #35 0x000055b2959bad2d clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang++-17+0xfd2d) [build] #36 0x000055b2959c7562 main (/usr/bin/clang++-17+0x1c562) [build] #37 0x00007f71e6a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 [build] #38 0x00007f71e6a29e40 call_init ./csu/../csu/libc-start.c:128:20 [build] #39 0x00007f71e6a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 [build] #40 0x000055b2959b7df5 _start (/usr/bin/clang++-17+0xcdf5) [build] clang++-17: error: clang frontend command failed with exit code 139 (use -v to see invocation) [build] Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77) [build] Target: x86_64-pc-linux-gnu [build] Thread model: posix [build] InstalledDir: /usr/bin [build] clang++-17: note: diagnostic msg: [build] ******************** [build] [build] PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: [build] Preprocessed source(s) and associated run script(s) are located at: [build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.cpp [build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.sh [build] clang++-17: note: diagnostic msg: [build] [build] ******************** ```
AaronBallman commented 7 months ago

The issue can be reproduced on godbolt with an asserts build but is too large for the short link generator to handle it.

Endilll commented 5 months ago

Confirmed on 19.0 and 18.1.0: https://godbolt.org/z/qaxGa7ocs Appears to be a regression in Clang 15. It also reminds me of #88077 Reduced by me and C-Reduce:

struct get_scheduler_t {
  void operator()();
};

template <class _Ty>
struct __box {
  [[no_unique_address]] _Ty __value;
};

struct __sexpr {
  __box<get_scheduler_t> __impl_;
};

void get_scheduler_t::operator()() {
  __sexpr{};
}

Clang 19.0 stack trace:

<source>:15:3: warning: expression result unused [-Wunused-value]
   15 |   __sexpr{};
      |   ^      ~~
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: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source>
1.  <eof> parser at end of file
2.  <source>:14:23: LLVM IR generation of declaration 'get_scheduler_t::operator()'
3.  <source>:14:23: Generating code for declaration 'get_scheduler_t::operator()'
 #0 0x0000000003979978 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3979978)
 #1 0x000000000397765c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x397765c)
 #2 0x00000000038c9018 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007943ecc42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00000000032c361e llvm::Instruction::eraseFromParent() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x32c361e)
 #5 0x00000000040e58d1 (anonymous namespace)::AggExprEmitter::VisitCXXParenListOrInitListExpr(clang::Expr*, llvm::ArrayRef<clang::Expr*>, clang::FieldDecl*, clang::Expr*) CGExprAgg.cpp:0:0
 #6 0x00000000040df90c (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
 #7 0x00000000040e6674 (anonymous namespace)::AggExprEmitter::VisitCastExpr(clang::CastExpr*) CGExprAgg.cpp:0:0
 #8 0x00000000040df141 (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) CGExprAgg.cpp:0:0
 #9 0x00000000040e012f clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40e012f)
#10 0x00000000040af9b5 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40af9b5)
#11 0x00000000040d1a0d clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40d1a0d)
#12 0x0000000003cb7dd5 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3cb7dd5)
#13 0x0000000003cbf84c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3cbf84c)
#14 0x0000000003d2253a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d2253a)
#15 0x0000000003d3611c clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d3611c)
#16 0x0000000003d96162 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d96162)
#17 0x0000000003d90a15 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d90a15)
#18 0x0000000003d91033 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d91033)
#19 0x0000000003d9b5f3 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#20 0x0000000004249b76 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#21 0x000000000423a238 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x423a238)
#22 0x0000000006285264 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6285264)
#23 0x0000000004246e08 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4246e08)
#24 0x00000000044c8199 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x44c8199)
#25 0x000000000445025e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x445025e)
#26 0x00000000045aef3e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45aef3e)
#27 0x0000000000c4fdec cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc4fdec)
#28 0x0000000000c4907a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#29 0x000000000428a649 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::'lambda'()>(long) Job.cpp:0:0
#30 0x00000000038c94c4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x38c94c4)
#31 0x000000000428ac3f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#32 0x0000000004250fd5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4250fd5)
#33 0x0000000004251a3d clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4251a3d)
#34 0x00000000042597c5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x42597c5)
#35 0x0000000000c4d285 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc4d285)
#36 0x0000000000b2f354 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xb2f354)
#37 0x00007943ecc29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#38 0x00007943ecc29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#39 0x0000000000c48b6e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc48b6e)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
llvmbot commented 5 months ago

@llvm/issue-subscribers-c-20

Author: Eric Niebler (ericniebler)

``` [build] [1/2 50% :: 2.757] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] FAILED: examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o [build] /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. [build] Stack dump: [build] 0. Program arguments: /usr/bin/clang++-17 -DSTDEXEC_ENABLE_EXTRA_TYPE_CHECKING -I/home/eniebler/Code/stdexec/include -fsanitize=address -Wsign-conversion -Wnarrowing -Werror -g -std=c++20 -Wall -ferror-limit=0 -fmacro-backtrace-limit=0 -ftemplate-backtrace-limit=0 -MD -MT examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -MF examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o.d -o examples/CMakeFiles/example.hello_world.dir/hello_world.cpp.o -c /home/eniebler/Code/stdexec/examples/hello_world.cpp [build] 1. <eof> parser at end of file [build] 2. Per-file LLVM IR generation [build] 3. /home/eniebler/Code/stdexec/include/stdexec/__detail/__basic_sender.hpp:464:7: Generating code for declaration 'stdexec::__detail::__captures' [build] #0 0x00007f71e7ecc406 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xccc406) [build] #1 0x00007f71e7eca5b0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xcca5b0) [build] #2 0x00007f71e7e20d70 (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20d70) [build] #3 0x00007f71e6a42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520) [build] #4 0x00007f71e7fe6943 llvm::Instruction::eraseFromParent() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xde6943) [build] #5 0x00007f71f05e5df0 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be5df0) [build] #6 0x00007f71f05e74cd (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1be74cd) [build] #7 0x00007f71f05db2bf clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1bdb2bf) [build] #8 0x00007f71f071383a clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1383a) [build] #9 0x00007f71f071bb6c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d1bb6c) [build] #10 0x00007f71f0774c0a clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d74c0a) [build] #11 0x00007f71f0775884 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d75884) [build] #12 0x00007f71f0795549 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d95549) [build] #13 0x00007f71f078ed78 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d8ed78) [build] #14 0x00007f71f07827b3 clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827b3) [build] #15 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #16 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #17 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #18 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #19 0x00007f71f07827cf clang::CodeGen::CodeGenModule::EmitDeferred() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d827cf) [build] #20 0x00007f71f07808bb clang::CodeGen::CodeGenModule::Release() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d808bb) [build] #21 0x00007f71f0828118 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1e28118) [build] #22 0x00007f71f076b420 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x1d6b420) [build] #23 0x00007f71ef437816 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0xa37816) [build] #24 0x00007f71f11570c5 clang::FrontendAction::Execute() (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27570c5) [build] #25 0x00007f71f10d26c4 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x26d26c4) [build] #26 0x00007f71f11d0e84 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x27d0e84) [build] #27 0x000055b2959bd856 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang++-17+0x12856) [build] #28 0x000055b2959bb3c5 (/usr/bin/clang++-17+0x103c5) [build] #29 0x00007f71f0d94c59 (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x2394c59) [build] #30 0x00007f71e7e20b0c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xc20b0c) [build] #31 0x00007f71f0d9449e clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x239449e) [build] #32 0x00007f71f0d5d40d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d40d) [build] #33 0x00007f71f0d5d66e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x235d66e) [build] #34 0x00007f71f0d791ed clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm-17/bin/../lib/libclang-cpp.so.17+0x23791ed) [build] #35 0x000055b2959bad2d clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang++-17+0xfd2d) [build] #36 0x000055b2959c7562 main (/usr/bin/clang++-17+0x1c562) [build] #37 0x00007f71e6a29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 [build] #38 0x00007f71e6a29e40 call_init ./csu/../csu/libc-start.c:128:20 [build] #39 0x00007f71e6a29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5 [build] #40 0x000055b2959b7df5 _start (/usr/bin/clang++-17+0xcdf5) [build] clang++-17: error: clang frontend command failed with exit code 139 (use -v to see invocation) [build] Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77) [build] Target: x86_64-pc-linux-gnu [build] Thread model: posix [build] InstalledDir: /usr/bin [build] clang++-17: note: diagnostic msg: [build] ******************** [build] [build] PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: [build] Preprocessed source(s) and associated run script(s) are located at: [build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.cpp [build] clang++-17: note: diagnostic msg: /tmp/hello_world-22be60.sh [build] clang++-17: note: diagnostic msg: [build] [build] ******************** ```
shafik commented 4 months ago

@Endilll looks fixed on latest trunk: https://godbolt.org/z/fqaYcTeP6