[LLVMbugs] [Bug 18358] New: "internal compiler error: Segmentation fault" on C++ code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 2 17:00:27 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18358

            Bug ID: 18358
           Summary: "internal compiler error: Segmentation fault" on C++
                    code
           Product: dragonegg
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: New Bugs
          Assignee: baldrick at free.fr
          Reporter: scott+llvm+bugzilla at pakin.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11804
  --> http://llvm.org/bugs/attachment.cgi?id=11804&action=edit
Small C++ file that crashes DragonEgg

The attached reproducer (dregg-seg.cpp) causes g++ to abort with an "internal
compiler error: Segmentation fault" in DragonEgg.  Here are the version numbers
of relevant programs:

  * DragonEgg/LLVM r198359
  * g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
  * Linux morbo 3.11.0-14-generic

The following gdb session shows how to reproduce the error and where in the
code the segmentation fault occurs:

    $ gdb --args /usr/bin/g++ -g -O2 -std=c++11 dregg-seg.cpp -o dregg-seg.ll
-S -fplugin=/tmp/byfl-install/lib/dragonegg.so -fplugin-arg-dragonegg-emit-ir 
    GNU gdb (GDB) 7.6.1-ubuntu
    Copyright (C) 2013 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /usr/bin/g++-4.8...(no debugging symbols
found)...done.
    (gdb) set follow-fork-mode child
    (gdb) run
    Starting program: /usr/bin/g++ -g -O2 -std=c++11 dregg-seg.cpp -o
dregg-seg.ll -S -fplugin=/tmp/byfl-install/lib/dragonegg.so
-fplugin-arg-dragonegg-emit-ir
    [New process 2218]
    process 2218 is executing new program:
/usr/lib/gcc/x86_64-linux-gnu/4.8/cc1plus
    Warning: couldn't activate thread debugging using libthread_db: Cannot find
new threads: generic error
    Warning: couldn't activate thread debugging using libthread_db: Cannot find
new threads: generic error
    warning: Unable to find libthread_db matching inferior's thread library,
thread debugging will not be available.

    Program received signal SIGSEGV, Segmentation fault.
    [Switching to process 2218]
    llvm::TypeFinder::incorporateType (this=this at entry=0x7fffffffde28,
Ty=<optimized out>) at TypeFinder.cpp:115
    115          if (VisitedTypes.insert(*I).second)
    (gdb) backtrace
    #0  llvm::TypeFinder::incorporateType (this=this at entry=0x7fffffffde28,
Ty=<optimized out>) at TypeFinder.cpp:115
    #1  0x00007ffff604137e in llvm::TypeFinder::run
(this=this at entry=0x7fffffffde28, M=..., onlyNamed=onlyNamed at entry=false) at
TypeFinder.cpp:45
    #2  0x00007ffff5f7d5a8 in llvm::TypePrinting::incorporateTypes
(this=0x7fffffffde28, M=...) at AsmWriter.cpp:169
    #3  0x00007ffff5f878f8 in llvm::Module::print (this=this at entry=0x15e5580,
ROS=..., AAW=AAW at entry=0x0) at AsmWriter.cpp:2135
    #4  0x00007ffff6038e22 in operator<< (M=..., O=...) at
/tmp/byfl-build/llvm/include/llvm/IR/Module.h:591
    #5  (anonymous namespace)::PrintModulePass::runOnModule (this=<optimized
out>, M=...) at PrintModulePass.cpp:40
    #6  0x00007ffff602f6f5 in runOnModule (M=..., this=<optimized out>) at
LegacyPassManager.cpp:1616
    #7  llvm::legacy::PassManagerImpl::run (this=0x16670a0, M=...) at
LegacyPassManager.cpp:1711
    #8  0x00007ffff57b7592 in llvm_finish_unit () at
/tmp/byfl-build/dragonegg/src/Backend.cpp:1967
    #9  0x000000000084e93a in invoke_plugin_callbacks_full(int, void*) ()
    #10 0x00000000008dc474 in ?? ()
    #11 0x00000000008ddcda in toplev_main(int, char**) ()
    #12 0x00007ffff69fbde5 in __libc_start_main (main=0x51c470 <main>, argc=25,
ubp_av=0x7fffffffe1f8, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, 
    stack_end=0x7fffffffe1e8) at libc-start.c:260
    #13 0x000000000051c6df in _start ()

The segfault goes away if "-O2" and/or "-fplugin-arg-dragonegg-emit-ir" is
omitted from the command line.

Regards,
-- Scott

P.S.  The reproducer is a heavily trimmed version of my Byfl tool.  See
https://github.com/losalamos/Byfl for the complete source code if you want
further DragonEgg stress-testing.

-- 
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/20140103/72c573a8/attachment.html>


More information about the llvm-bugs mailing list