<html>
    <head>
      <base href="http://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 --- - segfault generating debug symbols"
   href="http://llvm.org/bugs/show_bug.cgi?id=22114">22114</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>segfault generating debug symbols
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>f.sowade@r9e.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13645" name="attach_13645" title="Code crashing clang">attachment 13645</a> <a href="attachment.cgi?id=13645&action=edit" title="Code crashing clang">[details]</a></span>
Code crashing clang

The attached code segfaults clang when built using the current debian nightly
builds:

$ clang++-3.6 -g -c -std=c++11 final.cpp
0  libLLVM-3.6.so.1 0x00007f9367a25152 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.6.so.1 0x00007f9367a238a1
2  libpthread.so.0  0x00007f93661258d0
3  libLLVM-3.6.so.1 0x00007f9366e02a75 llvm::DwarfUnit::addString(llvm::DIE&,
llvm::dwarf::Attribute, llvm::StringRef) + 21
4  libLLVM-3.6.so.1 0x00007f9366de1ead
llvm::DwarfCompileUnit::applyVariableAttributes(llvm::DbgVariable const&,
llvm::DIE&) + 189
5  libLLVM-3.6.so.1 0x00007f9366dec31e
llvm::DwarfDebug::finishVariableDefinitions() + 302
6  libLLVM-3.6.so.1 0x00007f9366df0c26 llvm::DwarfDebug::finalizeModuleInfo() +
38
7  libLLVM-3.6.so.1 0x00007f9366dfd366 llvm::DwarfDebug::endModule() + 38
8  libLLVM-3.6.so.1 0x00007f9366dd2077
llvm::AsmPrinter::doFinalization(llvm::Module&) + 567
9  libLLVM-3.6.so.1 0x00007f9366c09599
llvm::FPPassManager::doFinalization(llvm::Module&) + 73
10 libLLVM-3.6.so.1 0x00007f9366c14575
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 789
11 clang            0x000000000089272a
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
3178
12 clang            0x0000000000880fd0
13 clang            0x0000000000a4abb5 clang::ParseAST(clang::Sema&, bool,
bool) + 741
14 clang            0x00000000006ed416 clang::FrontendAction::Execute() + 118
15 clang            0x00000000006ca641
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 289
16 clang            0x00000000006b3363
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1827
17 clang            0x00000000006ad998 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 1256
18 clang            0x00000000006acfc6 main + 9910
19 libc.so.6        0x00007f9364cfdb45 __libc_start_main + 245
20 clang            0x00000000006ad035
Stack dump:
0.      Program arguments: /usr/lib/llvm-3.6/bin/clang -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier
-main-file-name final.cpp -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.25
-g -dwarf-column-info -coverage-file /crosscan/src/reduce/final.cpp
-resource-dir /usr/lib/llvm-3.6/bin/../lib/clang/3.6.0 -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include -internal-externc-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /crosscan/src/reduce -ferror-limit 19 -fmessage-length
278 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o final.o -x c++ final.cpp
1.      <eof> parser at end of file
2.      Code generation
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
Debian clang version 3.6.0-svn225298-1~exp1 (trunk) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://bugs.debian.org/">http://bugs.debian.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg:
********************

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

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

$ clang++-3.6 --version
Debian clang version 3.6.0-svn225298-1~exp1 (trunk) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

compiling the same code without -g works:

$ clang++-3.6 -c -std=c++11 final.cpp
$</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>