Closed insoulity closed 4 years ago
Thanks for the bug report, @insoulity!
I was able to reproduce a similar stack trace when building with the LLVM 9.0.0 release. I tried LLVM trunk, however, and the crash no longer occurs. This makes me think this is a manifestation of bug report https://bugs.llvm.org/show_bug.cgi?id=41909, and that I may have fixed the issue in https://reviews.llvm.org/D70579, which is now part of Clang trunk.
It looks like you're using a Clang built from the last commit that was synced to the (now deprecated) Git mirror, specifically you built with this commit from October 22: https://github.com/llvm-mirror/clang/commit/65acf43270ea2894dffa0d0b292b92402f80c8cb
That commit doesn't include my fix, and on top of that, the Git mirrors of LLVM are no longer being updated, so your Clang will be stuck in Oct 22 2019 if you keep building it based on the mirror. If you switch to building from the new monorepo, https://github.com/llvm/llvm-project, you'll have a compiler that can compile cppcoro, and you'll receive fixes for any other coroutines bugs discovered in the future.
@modocache Thanks for all the comments!
Te bug report seems to be very relevant to what I've observed. Moreover, I didn't know that the mirror is now deprecated. I will be switching over to and staying on the monorepo to keep up with the latest fixes.
Thanks again for the quick response and great comments, Yongkee
I've just setup with the llvm-project repo that @modocache mentioned earlier and confirmed it's now working well.
Thanks a lot!
Hi Lewiss,
I got a compilation error with round_robin_scheduler_tests.cpp (on nano_coroutine branch).
FYI, I am compiling with Clang10 and most of test cases are compiling and running well so I am doubting if it's due to compiler version.
I've attached the error message and stack dump below and it would be great if you can give a quick comment on it.
Thanks,
Stack dump:
0 0x00000000010d523f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x10d523f)
1 0x00000000010d3ad3 llvm::sys::RunSignalHandlers() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x10d3ad3)
2 0x00000000010d3bd9 SignalHandler(int) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x10d3bd9)
3 0x00007f2e5df9f390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
4 0x000000000217b771 clang::Expr::getExprLoc() const (/media/ykwon/fa19/llvm/install/bin/clang-10+0x217b771)
5 0x00000000011d43f3 clang::CodeGen::ApplyDebugLocation::ApplyDebugLocation(clang::CodeGen::CodeGenFunction&, clang::Expr const*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x11d43f3)
6 0x0000000001328b29 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1328b29)
7 0x000000000132ad19 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x132ad19)
8 0x00000000012eec6f clang::CodeGen::CodeGenFunction::EmitCoroutineBody(clang::CoroutineBodyStmt const&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x12eec6f)
9 0x0000000001218d1b clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1218d1b)
10 0x000000000121f468 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x121f468)
11 0x000000000123db31 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123db31)
12 0x000000000123c64b clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123c64b)
13 0x000000000123fe18 clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe18)
14 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
15 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
16 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
17 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
18 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
19 0x000000000123fe6e clang::CodeGen::CodeGenModule::EmitDeferred() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fe6e)
20 0x000000000123fea4 clang::CodeGen::CodeGenModule::Release() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x123fea4)
21 0x0000000001777c13 (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1777c13)
22 0x0000000001776d8c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1776d8c)
23 0x0000000001c67761 clang::ParseAST(clang::Sema&, bool, bool) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1c67761)
24 0x0000000001775c13 clang::CodeGenAction::ExecuteAction() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1775c13)
25 0x0000000001471073 clang::FrontendAction::Execute() (/media/ykwon/fa19/llvm/install/bin/clang-10+0x1471073)
26 0x000000000144cc8b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x144cc8b)
27 0x00000000014c556c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x14c556c)
28 0x00000000009902eb cc1_main(llvm::ArrayRef<char const>, char const, void*) (/media/ykwon/fa19/llvm/install/bin/clang-10+0x9902eb)
29 0x0000000000944d58 main (/media/ykwon/fa19/llvm/install/bin/clang-10+0x944d58)
30 0x00007f2e5ccf4830 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
31 0x000000000098e569 _start (/media/ykwon/fa19/llvm/install/bin/clang-10+0x98e569)
clang-10: error: unable to execute command: Segmentation fault (core dumped) clang-10: error: clang frontend command failed due to signal (use -v to see invocation) clang version 10.0.0 (https://github.com/llvm-mirror/clang.git 65acf43270ea2894dffa0d0b292b92402f80c8cb) (https://github.com/llvm-mirror/llvm.git 2c4ca6832fa6b306ee6a7010bfb80a3f2596f824) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/ykwon/fa19/llvm/install/bin clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. clang-10: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-10: note: diagnostic msg: /media/ykwon/fa19/cppcoro_nano/round_robin_scheduler_tests-0e9360.cpp clang-10: note: diagnostic msg: /media/ykwon/fa19/cppcoro_nano/round_robin_scheduler_tests-0e9360.sh clang-10: note: diagnostic msg:
/home/ykwon/fa19/llvm/install/bin/clang: failed with exit code 254