[llvm-bugs] [Bug 32121] New: ThinLTO: infinite recursion in ThinLTOBitcodeWriter.cpp:245

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 2 14:04:07 PST 2017


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

            Bug ID: 32121
           Summary: ThinLTO: infinite recursion in
                    ThinLTOBitcodeWriter.cpp:245
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: krasin at google.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 18045
  --> https://bugs.llvm.org/attachment.cgi?id=18045&action=edit
private_virtual_destructor.cc

Consider the following C++ file:

$ cat private_virtual_destructor.cc
class a {
public:
  virtual ~a();
};
namespace __cxxabiv1 {
class __si_class_type_info : public a {
  ~__si_class_type_info();
};
__si_class_type_info::~__si_class_type_info() {}
}

Let's try to compile it:

$ clang++ -flto=thin -O2 -c private_virtual_destructor.cc -o
private_virtual_destructor.o

And...

#0 0x0000000001f5daff llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Support/Unix/Signals.inc:406:0
#1 0x0000000001f5bb0e llvm::sys::RunSignalHandlers()
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Support/Signals.cpp:45:0
#2 0x0000000001f5bc7c SignalHandler(int)
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Support/Unix/Signals.inc:246:0
#3 0x00007fef0b0bc330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00000000027e8284 (anonymous
namespace)::forEachVirtualFunction(llvm::Constant*, llvm::function_ref<void
(llvm::Function*)>) [clone .constprop.285]
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:241:0
#5 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:244:0
#6 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
#7 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
#8 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
...
...
...
#1255 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:244:0
#1256 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
#1257 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
#1258 0x00000000027e8567
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
#1259 0x00000000027e8567 (anonymous
namespace)::forEachVirtualFunction(llvm::Constant*, llvm::function_ref<void
(llvm::Function*)>) [clone .constprop.285]
/usr/local/google/home/krasin/src/llvm.org/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp:245:0
Stack dump:
0.      Program arguments:
/usr/local/google/home/krasin/src/llvm.org/release-build/bin/clang-5.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-llvm-bc -flto=thin -flto-unit
-disable-free -main-file-name private_virtual_destructor.cc -mrelocation-model
static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer
-dwarf-column-info -debugger-tuning=gdb -coverage-notes-file
/usr/local/google/home/krasin/chr33/src/private_virtual_destructor.gcno
-resource-dir
/usr/local/google/home/krasin/src/llvm.org/release-build/lib/clang/5.0.0
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/google/home/krasin/src/llvm.org/release-build/lib/clang/5.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O2
-fdeprecated-macro -fdebug-compilation-dir
/usr/local/google/home/krasin/chr33/src -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-vectorize-loops -vectorize-slp -o private_virtual_destructor.o -x c++
private_virtual_destructor.cc 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'ThinLTO Bitcode Writer' on module
'private_virtual_destructor.cc'.
clang-5.0: error: unable to execute command: Segmentation fault (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 296778)

-- 
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/20170302/e7f1203e/attachment.html>


More information about the llvm-bugs mailing list