[llvm-bugs] [Bug 31424] New: Assertion failure in XRayInstrumentation pass with non-default instruction threshold

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 18 19:03:50 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31424

            Bug ID: 31424
           Summary: Assertion failure in XRayInstrumentation pass with
                    non-default instruction threshold
           Product: XRay
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Compiler instrumentation
          Assignee: dberris at google.com
          Reporter: dberris at google.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161219/ae9996fc/attachment-0001.html>


More information about the llvm-bugs mailing list