<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - void (anonymous namespace)::CounterCoverageMappingBuilder::popRegions(size_t): Assertion `SpellingRegion(SM, Region).isInSourceOrder()' failed."
href="https://bugs.llvm.org/show_bug.cgi?id=47324">47324</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>void (anonymous namespace)::CounterCoverageMappingBuilder::popRegions(size_t): Assertion `SpellingRegion(SM, Region).isInSourceOrder()' failed.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>phosek@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=23897" name="attach_23897" title="Clang crash reproducer">attachment 23897</a> <a href="attachment.cgi?id=23897&action=edit" title="Clang crash reproducer">[details]</a></span>
Clang crash reproducer
We hit this assertion error recently when using -fprofile-instr-generate, the
original source file this was triggered by is
<a href="https://fuchsia.googlesource.com/fuchsia/+/8e92e01f1ec5d1314b1fd7fbaf7de5e9d60f1282/zircon/system/ulib/async-loop/loop.c">https://fuchsia.googlesource.com/fuchsia/+/8e92e01f1ec5d1314b1fd7fbaf7de5e9d60f1282/zircon/system/ulib/async-loop/loop.c</a>,
reproducer is attached.
clang:
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:692: void
(anonymous namespace)::CounterCoverageMappingBuilder::popRegions(size_t):
Assertion `SpellingRegion(SM, Region).isInSourceOrder()' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /src/clang-llvm/llvm-build/debug/bin/clang -cc1
-triple x86_64-unknown-fuchsia -emit-obj -mrelax-all --mrelax-relocations
-disable-free -main-file-name loop.c -mrelocation-model pic -pic-level 2
-pic-is-pie -mframe-pointer=all -fno-rounding-math -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-feature +cx16
-fno-split-dwarf-inlining -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -ffunction-sections -fdata-sections
-fprofile-instrument=clang -fcoverage-mapping -sys-header-deps -D
TOOLCHAIN_VERSION=76QQjnDH_N4AL7fFVEpuDgAELUGvfVCFDij82FV-hz8C -D
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D
_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D ZX_ASSERT_LEVEL=2 -D _ALL_SOURCE
-O0 -Wall -Wextra -Wnewline-eof -Wno-unused-parameter
-Wno-unknown-warning-option -Wno-sign-conversion -Wno-unknown-warning-option
-Wno-c99-designator -Wno-int-in-bool-context -Wno-address-of-packed-member
-Wno-range-loop-analysis -Wno-deprecated-declarations -Werror
-Wno-error=deprecated-declarations -Wthread-safety -std=c11 -ferror-limit 19
-fvisibility hidden -fsanitize=safe-stack -stack-protector 2
-ftrivial-auto-var-init=pattern -fgnuc-version=4.2.1 -fcolor-diagnostics
-faddrsig -x c loop-1bb553.c
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. ../../zircon/system/ulib/async-loop/loop.c:694:18: Generating code for
declaration 'async_loop_next_deadline_locked'
#0 0x0000000008680307 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:563:11
#1 0x00000000086803f9 PrintStackTraceSignalHandler(void*)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:624:1
#2 0x000000000867ed3b llvm::sys::RunSignalHandlers()
/src/clang-llvm/llvm-project/llvm/lib/Support/Signals.cpp:69:5
#3 0x0000000008680a43 SignalHandler(int)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:405:1
#4 0x00007f36d8c67140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
#5 0x00007f36d8926db1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#6 0x00007f36d8910537 abort ./stdlib/abort.c:81:7
#7 0x00007f36d891040f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
#8 0x00007f36d891040f _nl_load_domain ./intl/loadmsgcat.c:970:34
#9 0x00007f36d891f5b2 (/lib/x86_64-linux-gnu/libc.so.6+0x345b2)
#10 0x000000000927a80f (anonymous
namespace)::CounterCoverageMappingBuilder::popRegions(unsigned long)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:0:9
#11 0x000000000928324f (anonymous
namespace)::CounterCoverageMappingBuilder::fillGapAreaWithCount(clang::SourceLocation,
clang::SourceLocation, llvm::coverage::Counter)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:889:3
#12 0x000000000927f87c (anonymous
namespace)::CounterCoverageMappingBuilder::VisitIfStmt(clang::IfStmt const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:1275:20
#13 0x0000000009278e9b clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder, void>::Visit(clang::Stmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:121:1
#14 0x0000000009282cb3 (anonymous
namespace)::CounterCoverageMappingBuilder::VisitStmt(clang::Stmt const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:925:5
#15 0x000000000927ebf3 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder,
void>::VisitCompoundStmt(clang::CompoundStmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:73:1
#16 0x0000000009278ddb clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder, void>::Visit(clang::Stmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:73:1
#17 0x000000000927848c (anonymous
namespace)::CounterCoverageMappingBuilder::propagateCounts(llvm::coverage::Counter,
clang::Stmt const*, bool)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:0:7
#18 0x000000000927f70d (anonymous
namespace)::CounterCoverageMappingBuilder::VisitIfStmt(clang::IfStmt const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:1266:24
#19 0x0000000009278e9b clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder, void>::Visit(clang::Stmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:121:1
#20 0x0000000009282cb3 (anonymous
namespace)::CounterCoverageMappingBuilder::VisitStmt(clang::Stmt const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:925:5
#21 0x000000000927ebf3 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder,
void>::VisitCompoundStmt(clang::CompoundStmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:73:1
#22 0x0000000009278ddb clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous
namespace)::CounterCoverageMappingBuilder, void>::Visit(clang::Stmt const*)
/src/clang-llvm/llvm-build/debug/tools/clang/include/clang/AST/StmtNodes.inc:73:1
#23 0x000000000927848c (anonymous
namespace)::CounterCoverageMappingBuilder::propagateCounts(llvm::coverage::Counter,
clang::Stmt const*, bool)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:0:7
#24 0x0000000009277751 (anonymous
namespace)::CounterCoverageMappingBuilder::VisitDecl(clang::Decl const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:948:5
#25 0x0000000009277503
clang::CodeGen::CoverageMappingGen::emitCounterMapping(clang::Decl const*,
llvm::raw_ostream&)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CoverageMappingGen.cpp:1570:16
#26 0x0000000008bc43fd
clang::CodeGen::CodeGenPGO::emitCounterRegionMapping(clang::Decl const*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp:867:3
#27 0x0000000008bc4020
clang::CodeGen::CodeGenPGO::assignRegionCounters(clang::GlobalDecl,
llvm::Function*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp:805:7
#28 0x0000000008daadcf
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1292:7
#29 0x0000000008c657cd
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:4558:3
#30 0x0000000008c5d0d9
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2918:12
#31 0x0000000008c53d03 clang::CodeGen::CodeGenModule::EmitDeferred()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2236:5
#32 0x0000000008c53d4e clang::CodeGen::CodeGenModule::EmitDeferred()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2242:7
#33 0x0000000008c53d4e clang::CodeGen::CodeGenModule::EmitDeferred()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2242:7
#34 0x0000000008c53d4e clang::CodeGen::CodeGenModule::EmitDeferred()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:2242:7
#35 0x0000000008c52152 clang::CodeGen::CodeGenModule::Release()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:405:3
#36 0x00000000096e0802 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:0:18
#37 0x00000000096dbb81
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:283:14
#38 0x000000000bd03ab8 clang::ParseAST(clang::Sema&, bool, bool)
/src/clang-llvm/llvm-project/clang/lib/Parse/ParseAST.cpp:178:12
#39 0x000000000951068d clang::ASTFrontendAction::ExecuteAction()
/src/clang-llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1059:1
#40 0x00000000096d8614 clang::CodeGenAction::ExecuteAction()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1183:1
#41 0x0000000009510088 clang::FrontendAction::Execute()
/src/clang-llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:954:7
#42 0x000000000943d68b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/src/clang-llvm/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:984:23
#43 0x00000000096c9634
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/src/clang-llvm/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:8
#44 0x00000000054b3b75 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /src/clang-llvm/llvm-project/clang/tools/driver/cc1_main.cpp:240:13
#45 0x00000000054a6a8a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/src/clang-llvm/llvm-project/clang/tools/driver/driver.cpp:330:5
#46 0x00000000054a5c9d main
/src/clang-llvm/llvm-project/clang/tools/driver/driver.cpp:407:5
#47 0x00007f36d8911cca __libc_start_main ./csu/../csu/libc-start.c:308:16
#48 0x00000000054a543a _start
(/src/clang-llvm/llvm-build/debug/bin/clang+0x54a543a)
zsh: abort "/src/clang-llvm/llvm-build/debug/bin/clang" "-cc1" "-triple"
"-emit-obj"</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>