<html>
    <head>
      <base href="https://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 --- - [GCOV] Crashes when trying to compile a simple cpp file"
   href="https://llvm.org/bugs/show_bug.cgi?id=30678">30678</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GCOV] Crashes when trying to compile a simple cpp file
          </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>Linux
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hxy9243@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17427" name="attach_17427" title="Debug script generated from clang.">attachment 17427</a> <a href="attachment.cgi?id=17427&action=edit" title="Debug script generated from clang.">[details]</a></span>
Debug script generated from clang.

As of trunk on Oct. 11, the x86_64 LLVM compiler is still crashing when trying
to compile with the GCOV option. The following is the clang backtrace output.

Attached is the slightly modified debug shell and preprocessed cpp from clang.


---------------

clang -cc1 version 4.0.0 based upon LLVM 4.0.0svn default target
x86_64-unknown-linux-gnu
#include "..." search starts here:
End of search list.
clang-4.0: /tmp/tmp.6qQhiGb7vv/llvm/lib/Support/raw_ostream.cpp:525: virtual
size_t llvm::raw_fd_ostream::preferred_buffer_size() const: Assertion `FD >= 0
&& "File not yet open!"' failed.
#0 0x00007f3594c2e235 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xde235)
#1 0x00007f3594c2bf8e llvm::sys::RunSignalHandlers()
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xdbf8e)
#2 0x00007f3594c2c0f2 SignalHandler(int)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xdc0f2)
#3 0x00007f3598113330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007f3592adfc37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f3592ae3028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f3592ad8bf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f3592ad8ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#8 0x00007f3594c0e21e
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xbe21e)
#9 0x00007f3594c0e53f llvm::raw_ostream::SetBuffered()
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xbe53f)
#10 0x00007f3594c0ecd3 llvm::raw_ostream::write(char const*, unsigned long)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMSupport.so.40+0xbecd3)
#11 0x00007f35987b0bd6 (anonymous namespace)::GCOVProfiler::emitProfileNotes()
[clone .constprop.327]
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMInstrumentation.so.40+0x47bd6)
#12 0x00007f35987b2118 (anonymous
namespace)::GCOVProfilerLegacyPass::runOnModule(llvm::Module&)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMInstrumentation.so.40+0x49118)
#13 0x00007f3595feda8d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libLLVMCore.so.40+0x163a8d)
#14 0x00007f359761fe07 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> >)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangCodeGen.so.40+0x77e07)
#15 0x00007f35977dc30e
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangCodeGen.so.40+0x23430e)
#16 0x00007f358ff99238 clang::ParseAST(clang::Sema&, bool, bool)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/../lib/libclangParse.so.40+0x2c238)
#17 0x00007f35977d7ac7 clang::CodeGenAction::ExecuteAction()
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangCodeGen.so.40+0x22fac7)
#18 0x00007f3596fc8fa6 clang::FrontendAction::Execute()
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangFrontend.so.40+0xb2fa6)
#19 0x00007f3596f920f6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangFrontend.so.40+0x7c0f6)
#20 0x00007f3596d148bb
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/../lib/libclangFrontendTool.so.40+0x38bb)
#21 0x000000000040ff28 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/clang-4.0+0x40ff28)
#22 0x000000000040e704 main
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/clang-4.0+0x40e704)
#23 0x00007f3592acaf45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#24 0x000000000040ac29 _start
(/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/clang-4.0+0x40ac29)
Stack dump:
0.      Program arguments:
/sarc-c/compiler_tmp/tools/cross/llvm-4.0/2016-10-11-23-30-38-80cf341-master/bin/clang-4.0
-cc1 -triple x86_64--linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name src.cxx -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -femit-coverage-notes -femit-coverage-data
-coverage-notes-file
/work/x.hu/build/libcxx_sharedptr_patch/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_944e3.dir/src.cxx.gcno
-coverage-data-file
/work/x.hu/build/libcxx_sharedptr_patch/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_944e3.dir/src.cxx.gcda
-nostdinc++ -D HAVE_CXX_FLAG_COVERAGE -Wno-unused-command-line-argument -Wall
-Wextra -Wshadow -Wshorten-64-to-32 -Wfloat-equal -Wstrict-aliasing
-Wthread-safety -pedantic -pedantic-errors -std=c++11 -fdeprecated-macro
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -x c++ src-f47e53.cpp -v 
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'GCOV Profiler' on module 'src-f47e53.cpp'.
src-f47e53.sh: line 8: 26262 Aborted                 (core dumped) $CC "-cc1"
"-triple" "x86_64--linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "src.cxx" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mdisable-fp-elim" "-fmath-errno" "-masm-verbose"
"-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu"
"x86-64" "-dwarf-column-info" "-debugger-tuning=gdb" "-femit-coverage-notes"
"-femit-coverage-data" "-coverage-notes-file"
"/work/x.hu/build/libcxx_sharedptr_patch/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_944e3.dir/src.cxx.gcno"
"-coverage-data-file"
"/work/x.hu/build/libcxx_sharedptr_patch/benchmarks/benchmark-libcxx/src/google-benchmark-libcxx-build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_944e3.dir/src.cxx.gcda"
"-nostdinc++" "-D" "HAVE_CXX_FLAG_COVERAGE" "-Wno-unused-command-line-argument"
"-Wall" "-Wextra" "-Wshadow" "-Wshorten-64-to-32" "-Wfloat-equal"
"-Wstrict-aliasing" "-Wthread-safety" "-pedantic" "-pedantic-errors"
"-std=c++11" "-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "0"
"-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-x" "c++" "src-f47e53.cpp" -v</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>