Closed llvmbot closed 8 years ago
Fixed in https://reviews.llvm.org/rL281784
This is what it reduced to:
define i8 @zot() safestack { bb: %tmp = alloca i8, align 8 %tmp2 = bitcast i8* %tmp to i8 br label %bb3
bb3: ; preds = %bb3, %bb call void @llvm.lifetime.start(i64 8, i8* nonnull %tmp2) %tmp4 = call i32 @wombat(i8* nonnull %tmp) indirectbr i8 undef, [label %bb3] }
declare i32 @wombat(i8**)
non-minimized bitcode reproducer opt -safe-stack 2.ll # attached
Extended Description
I was attempting to build Python v.3.5.2 with SafeStack enabled when the following assertion failure occurred. I have attached the preprocessed source and the run script. Here is the backtrace:
clang-4.0: /home/mlemay/llvm/llvm/lib/CodeGen/SafeStackColoring.cpp:217: void llvm::safestack::StackColoring::calculateLiveIntervals(): Assertion `!Started.test(AllocaNo)' failed.
0 0x00000000024fe259 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x24fe259)
1 0x00000000024fe5f8 PrintStackTraceSignalHandler(void*) (/home/mlemay/llvm/inst/bin/clang-4.0+0x24fe5f8)
2 0x00000000024fc5be llvm::sys::RunSignalHandlers() (/home/mlemay/llvm/inst/bin/clang-4.0+0x24fc5be)
3 0x00000000024fd9e4 SignalHandler(int) (/home/mlemay/llvm/inst/bin/clang-4.0+0x24fd9e4)
4 0x00007ff151b793d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113d0)
5 0x00007ff1508e6418 gsignal /build/glibc-GKVZIf/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
6 0x00007ff1508e801a abort /build/glibc-GKVZIf/glibc-2.23/stdlib/abort.c:91:0
7 0x00007ff1508debd7 __assert_fail_base /build/glibc-GKVZIf/glibc-2.23/assert/assert.c:92:0
8 0x00007ff1508dec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
9 0x0000000001badb64 llvm::safestack::StackColoring::calculateLiveIntervals() (/home/mlemay/llvm/inst/bin/clang-4.0+0x1badb64)
10 0x0000000001bae885 llvm::safestack::StackColoring::run() (/home/mlemay/llvm/inst/bin/clang-4.0+0x1bae885)
11 0x0000000001ba4aac (anonymous namespace)::SafeStack::moveStaticAllocasToUnsafeStack(llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>&, llvm::Function&, llvm::ArrayRef<llvm::AllocaInst>, llvm::ArrayRef<llvm::Argument>, llvm::ArrayRef<llvm::ReturnInst>, llvm::Instruction, llvm::AllocaInst*) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1ba4aac)
12 0x0000000001ba69e2 (anonymous namespace)::SafeStack::runOnFunction(llvm::Function&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1ba69e2)
13 0x0000000001f8c590 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1f8c590)
14 0x0000000001f8c729 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1f8c729)
15 0x0000000001f8caa4 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1f8caa4)
16 0x0000000001f8d1d5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1f8d1d5)
17 0x0000000001f8d3e1 llvm::legacy::PassManager::run(llvm::Module&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x1f8d3e1)
18 0x000000000279d1d9 (anonymous namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) (/home/mlemay/llvm/inst/bin/clang-4.0+0x279d1d9)
19 0x000000000279df21 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) (/home/mlemay/llvm/inst/bin/clang-4.0+0x279df21)
20 0x0000000003185d65 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x3185d65)
21 0x0000000003cdbc81 clang::ParseAST(clang::Sema&, bool, bool) (/home/mlemay/llvm/inst/bin/clang-4.0+0x3cdbc81)
22 0x0000000002d2af21 clang::ASTFrontendAction::ExecuteAction() (/home/mlemay/llvm/inst/bin/clang-4.0+0x2d2af21)
23 0x000000000318908a clang::CodeGenAction::ExecuteAction() (/home/mlemay/llvm/inst/bin/clang-4.0+0x318908a)
24 0x0000000002d2a98e clang::FrontendAction::Execute() (/home/mlemay/llvm/inst/bin/clang-4.0+0x2d2a98e)
25 0x0000000002cd9b45 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/mlemay/llvm/inst/bin/clang-4.0+0x2cd9b45)
26 0x0000000002e58b7e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/mlemay/llvm/inst/bin/clang-4.0+0x2e58b7e)
27 0x00000000015a41e2 cc1_main(llvm::ArrayRef<char const>, char const, void*) (/home/mlemay/llvm/inst/bin/clang-4.0+0x15a41e2)
28 0x000000000159a64e ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) (/home/mlemay/llvm/inst/bin/clang-4.0+0x159a64e)
29 0x000000000159b2d9 main (/home/mlemay/llvm/inst/bin/clang-4.0+0x159b2d9)
30 0x00007ff1508d1830 __libc_start_main /build/glibc-GKVZIf/glibc-2.23/csu/../csu/libc-start.c:325:0
31 0x0000000001596609 _start (/home/mlemay/llvm/inst/bin/clang-4.0+0x1596609)
Stack dump: