<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Assertion failure in XRayInstrumentation pass with non-default instruction threshold"
href="https://llvm.org/bugs/show_bug.cgi?id=31424">31424</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failure in XRayInstrumentation pass with non-default instruction threshold
</td>
</tr>
<tr>
<th>Product</th>
<td>XRay
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Compiler instrumentation
</td>
</tr>
<tr>
<th>Assignee</th>
<td>dberris@google.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dberris@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>It seems like the XRay instrumentation pass is having issues with some machine
instructions. Reproducible at trunk (clang r290072, llvm r290070, compiler-rt
r289971).
/usr/local/google/home/varno/LLVM/clang-build/bin/clang++ -DGTEST_HAS_RTTI=0
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -Ilib/Support
-I/usr/local/google/home/varno/LLVM/llvm/lib/Support -Iinclude
-I/usr/local/google/home/varno/LLVM/llvm/include -fxray-instrument
-fxray-instruction-threshold=10 -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers
-pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor
-Wdelete-non-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics
-ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -fno-rtti
-MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o -MF
lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o.d -o
lib/Support/CMakeFiles/LLVMSupport.dir/Path.cpp.o -c
/usr/local/google/home/varno/LLVM/llvm/lib/Support/Path.cpp
clang-4.0:
/usr/local/google/home/varno/LLVM/llvm/include/llvm/ADT/ilist_iterator.h:126:
reference
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true,
true, void>, false, false>::operator*() const [OptionsT =
llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>,
IsReverse = false, IsConst = false]: Assertion `!NodePtr->isKnownSentinel()'
failed.
Relevant stack traces:
#9 0x00007fcf4adc83bb
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true,
true, void>, false, false>::operator*() const
/usr/local/google/home/varno/LLVM/llvm/include/llvm/ADT/ilist_iterator.h:127:33
#10 0x00007fcf4adc2fc5 llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>::operator*() const
/usr/local/google/home/varno/LLVM/llvm/include/llvm/CodeGen/MachineInstrBundleIterator.h:161:33
#11 0x00007fcf4b27fd3d (anonymous
namespace)::XRayInstrumentation::runOnMachineFunction(llvm::MachineFunction&)
/usr/local/google/home/varno/LLVM/llvm/lib/CodeGen/XRayInstrumentation.cpp:133:9
#12 0x00007fcf4afe5891
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/usr/local/google/home/varno/LLVM/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:8
#13 0x00007fcf4a70134f llvm::FPPassManager::runOnFunction(llvm::Function&)
/usr/local/google/home/varno/LLVM/llvm/lib/IR/LegacyPassManager.cpp:1513:23
#14 0x00007fcf4a701665 llvm::FPPassManager::runOnModule(llvm::Module&)
/usr/local/google/home/varno/LLVM/llvm/lib/IR/LegacyPassManager.cpp:1534:16
#15 0x00007fcf4a701dfa (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/usr/local/google/home/varno/LLVM/llvm/lib/IR/LegacyPassManager.cpp:1590:23
#16 0x00007fcf4a701926 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/usr/local/google/home/varno/LLVM/llvm/lib/IR/LegacyPassManager.cpp:1693:16
#17 0x00007fcf4a702311 llvm::legacy::PassManager::run(llvm::Module&)
/usr/local/google/home/varno/LLVM/llvm/lib/IR/LegacyPassManager.cpp:1724:3
#18 0x00007fcf465886aa (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:725:5
#19 0x00007fcf46587494 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<llvm::raw_pwrite_stream> >)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:821:3
#20 0x00007fcf468fc9ff
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:228:7
#21 0x00007fcf3f8ad3e9 clang::ParseAST(clang::Sema&, bool, bool)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/Parse/ParseAST.cpp:159:3
#22 0x00007fcf45cf3aba clang::ASTFrontendAction::ExecuteAction()
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:560:1
#23 0x00007fcf468f97fb clang::CodeGenAction::ExecuteAction()
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:909:1
#24 0x00007fcf45cf35a0 clang::FrontendAction::Execute()
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:463:7
#25 0x00007fcf45c7761f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:931:7
#26 0x00007fcf4586f7a9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:8
#27 0x0000000000424c4a cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/tools/driver/cc1_main.cpp:221:11
#28 0x0000000000418a19 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/usr/local/google/home/varno/LLVM/llvm/tools/clang/tools/driver/driver.cpp:299:5
#29 0x0000000000417698 main
/usr/local/google/home/varno/LLVM/llvm/tools/clang/tools/driver/driver.cpp:380:5
#30 0x00007fcf44c93f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#31 0x0000000000416884 _start
(/usr/local/google/home/varno/LLVM/clang-build/bin/clang-4.0+0x416884)
Reported by Alexis Shaw.
This is encountered when building clang/llvm with the XRay instrumentation,
using instruction threshold=1. To reproduce, here's the CMake invocation of the
LLVM/Clang build, where clang++ and clang are built from trunk (available from
path):
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja \
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fxray-instrument
-fxray-instruction-threshold=1"\
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fxray-instrument
-fxray-instruction-threshold=1"\
-DCMAKE_ASM_COMPILER=clang -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=gold \
../llvm</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>