[llvm-bugs] [Bug 31853] New: LLVM code generator segfault in llvm::FoldingSetImpl::RemoveNode

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 3 01:13:36 PST 2017


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

            Bug ID: 31853
           Summary: LLVM code generator segfault in
                    llvm::FoldingSetImpl::RemoveNode
           Product: new-bugs
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hans.ellegard at crunchfish.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Compiling OpenCV 3.1 with Clang 3.9, I get a segfault in
llvm::FoldingSetImpl::RemoveNode when compiling the file
modules/imgproc/src/imgwarp.cpp.

$ uname -a
Linux candiru 4.9.6-1-ARCH #1 SMP PREEMPT Thu Jan 26 09:22:26 CET 2017 x86_64
GNU/Linux

Unfortunately, when generating data for this bug report, bugpoint and llc were
not cooperative (and I didn't take the time to figure out how to make them
cooperate):
$ bugpoint -run-llc imgwrap.bc

Stack trace:

#0 0x00007f2c4a390698 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/bin/../lib/libLLVM-3.9.so+0x6d6698)
#1 0x00007f2c4a38e5fe llvm::sys::RunSignalHandlers()
(/usr/bin/../lib/libLLVM-3.9.so+0x6d45fe)
#2 0x00007f2c4a38e73a (/usr/bin/../lib/libLLVM-3.9.so+0x6d473a)
#3 0x00007f2c493b00b0 __restore_rt (/usr/bin/../lib/libc.so.6+0x330b0)
#4 0x00007f2c4a32ac5f
llvm::FoldingSetImpl::RemoveNode(llvm::FoldingSetImpl::Node*)
(/usr/bin/../lib/libLLVM-3.9.so+0x670c5f)
#5 0x00007f2c4a8a13f7 llvm::SelectionDAG::RemoveNodeFromCSEMaps(llvm::SDNode*)
(/usr/bin/../lib/libLLVM-3.9.so+0xbe73f7)
#6 0x00007f2c4a8a246b llvm::SelectionDAG::MorphNodeTo(llvm::SDNode*, unsigned
int, llvm::SDVTList, llvm::ArrayRef<llvm::SDValue>)
(/usr/bin/../lib/libLLVM-3.9.so+0xbe846b)
#7 0x00007f2c4a8b2cdb llvm::SelectionDAGISel::MorphNode(llvm::SDNode*, unsigned
int, llvm::SDVTList, llvm::ArrayRef<llvm::SDValue>, unsigned int)
(/usr/bin/../lib/libLLVM-3.9.so+0xbf8cdb)
#8 0x00007f2c4a8b8b81 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*,
unsigned char const*, unsigned int) (/usr/bin/../lib/libLLVM-3.9.so+0xbfeb81)
#9 0x00007f2c4b945ca7 (/usr/bin/../lib/libLLVM-3.9.so+0x1c8bca7)
#10 0x00007f2c4a8b1c39 llvm::SelectionDAGISel::DoInstructionSelection()
(/usr/bin/../lib/libLLVM-3.9.so+0xbf7c39)
#11 0x00007f2c4a8b460b llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/usr/bin/../lib/libLLVM-3.9.so+0xbfa60b)
#12 0x00007f2c4a8bb75e
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/usr/bin/../lib/libLLVM-3.9.so+0xc0175e)
#13 0x00007f2c4a8be33b
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/usr/bin/../lib/libLLVM-3.9.so+0xc0433b)
#14 0x00007f2c4b948a44 (/usr/bin/../lib/libLLVM-3.9.so+0x1c8ea44)
#15 0x00007f2c4a5bd1d1
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/usr/bin/../lib/libLLVM-3.9.so+0x9031d1)
#16 0x00007f2c4a4557c2 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/bin/../lib/libLLVM-3.9.so+0x79b7c2)
#17 0x00007f2c4a455b4b llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/bin/../lib/libLLVM-3.9.so+0x79bb4b)
#18 0x00007f2c4a455e74 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/bin/../lib/libLLVM-3.9.so+0x79be74)
#19 0x000000000071e443 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/bin/clang-3.9+0x71e443)
#20 0x0000000000ab2d91 (/usr/bin/clang-3.9+0xab2d91)
#21 0x0000000000bfc1ea clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/clang-3.9+0xbfc1ea)
#22 0x0000000000a2db3e clang::FrontendAction::Execute()
(/usr/bin/clang-3.9+0xa2db3e)
#23 0x00000000009fe536
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/clang-3.9+0x9fe536)
#24 0x0000000000ab1a92
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/clang-3.9+0xab1a92)
#25 0x00000000006dbce8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-3.9+0x6dbce8)
#26 0x00000000006d7f0d main (/usr/bin/clang-3.9+0x6d7f0d)
#27 0x00007f2c4939d291 __libc_start_main (/usr/bin/../lib/libc.so.6+0x20291)
#28 0x00000000006d9c1a _start (/usr/bin/clang-3.9+0x6d9c1a)

Stack dump:

0.    Program arguments: /usr/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name imgwarp.cpp -mrelocation-model pic
-pic-level 2 -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-feature +sse -target-feature +sse2 -target-feature +avx
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb
-ffunction-sections -coverage-file
/home/hansellegard/git/touchless-a3d/prebuilt_dependencies/tmp/PC/modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/imgwarp.cpp.o
-resource-dir /usr/bin/../lib/clang/3.9.1 -isystem
/home/hansellegard/git/touchless-a3d/prebuilt_dependencies/tmp/PC/3rdparty/tbb/tbb43_20141204oss/include
-D TBB_USE_GCC_BUILTINS=1 -D __OPENCV_BUILD=1 -D
__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1 -I
/home/hansellegard/git/touchless-a3d/prebuilt_dependencies/tmp/PC -I
/home/hansellegard/git/touchless-a3d/code/opencv/modules/imgproc/include -I
/home/hansellegard/git/touchless-a3d/code/opencv/modules/imgproc/src -I
/home/hansellegard/git/touchless-a3d/prebuilt_dependencies/tmp/PC/modules/imgproc
-I /home/hansellegard/git/touchless-a3d/code/opencv/modules/core/include -D
NDEBUG -D NDEBUG -internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/x86_64-pc-linux-gnu
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/6.3.1/../../../../include/c++/6.3.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.9.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -O3 -W -Werror=return-type
-Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat
-Werror=format-security -Wmissing-declarations -Wmissing-prototypes
-Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo
-Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args
-Wno-long-long -fdeprecated-macro -fdebug-compilation-dir
/home/hansellegard/git/touchless-a3d/prebuilt_dependencies/tmp/PC/modules/imgproc
-ferror-limit 19 -fmessage-length 0 -fvisibility hidden
-fvisibility-inlines-hidden -pthread -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o
CMakeFiles/opencv_imgproc.dir/src/imgwarp.cpp.o -x c++
/home/hansellegard/git/touchless-a3d/code/opencv/modules/imgproc/src/imgwarp.cpp 
1.    <eof> parser at end of file
2.    Code generation
3.    Running pass 'Function Pass Manager' on module
'/home/hansellegard/git/touchless-a3d/code/opencv/modules/imgproc/src/imgwarp.cpp'.
4.    Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_ZN2cvL13remapBilinearINS_4CastIffEENS_10RemapNoVecEfEEvRKNS_3MatERS4_S6_S6_PKviRKNS_7Scalar_IdEE'

clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/imgwarp-cce5b3.cpp
clang-3.9: note: diagnostic msg: /tmp/imgwarp-cce5b3.sh
clang-3.9: note: diagnostic msg: 

********************

-- 
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/20170203/1c9aaef0/attachment-0001.html>


More information about the llvm-bugs mailing list