Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

round_robin_scheduler_tests.cpp compile error with clang10 #135

Closed
insoulity opened this issue Dec 22, 2019 · 3 comments
Closed

round_robin_scheduler_tests.cpp compile error with clang10 #135

insoulity opened this issue Dec 22, 2019 · 3 comments

Comments

@insoulity
Copy link

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. Program arguments: /media/ykwon/fa19/llvm/install/bin/clang-10 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name round_robin_scheduler_tests.cpp -mrelocation-model static -mth
read-model posix -mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -resource-dir /media/ykwon/fa19/llvm/install/li
b/clang/10.0.0 -dependency-file /tmp/CakeGccDepbdVVNG -MT build/linux_x64_clang10.0.0_debug/test/obj/round_robin_scheduler_tests.o -sys-header-deps -D CPPCORO_RELEASE_DEBUG -I ./include -internal-isystem /media/ykwon/fa19/llvm/install/bin/../include/c++/v1 -internal-
isystem /usr/local/include -internal-isystem /media/ykwon/fa19/llvm/install/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -std=c++1z -fdeprecated-macro -f
debug-compilation-dir /media/ykwon/fa19/cppcoro_nano -ferror-limit 19 -fmessage-length 0 -fcoroutines-ts -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -o build/linux_x64_clang10.0.0_debug/test/obj/round_robi
n_scheduler_tests.o -x c++ test/round_robin_scheduler_tests.cpp

  1.  <eof> parser at end of file
    
  2.  Per-file LLVM IR generation
    
  3.  test/round_robin_scheduler_tests.cpp:100:20: Generating code for declaration '(anonymous namespace)::multi_binary_search(const int *, size_t, const int *, size_t *, size_t)::(anonymous class)::operator()'
    

#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

@modocache
Copy link
Contributor

modocache commented Dec 22, 2019

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: llvm-mirror/clang@65acf43

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.

@insoulity
Copy link
Author

@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

@insoulity
Copy link
Author

I've just setup with the llvm-project repo that @modocache mentioned earlier and confirmed it's now working well.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants