<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61220>61220</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Met "clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          GwokHiujin
      </td>
    </tr>
</table>

<pre>
    Recently I'm trying to learn how to develop checkers for Clang Static Analyzer. The clang version is:

``` shell
clang version 16.0.0 (https://github.com/llvm/llvm-project.git 97a1c98f8e38698bdd861dfd69301d2e11e89863)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
```

However when debugging a quite simple C program using clang debug checker, I encountered the code 134 problem as described in the title. The example program is shown below:

``` c
#include <stdio.h>

void foo(float i1) {
    float i2 = i1 + 5;
}

int main(){
    float x = 3;
    foo(x);
    return 0;
}
```

Then, I use command  `clang --analyze -Xanalyzer -analyzer-checker=debug.ViewExplodedGraph test.c` to visualize the analysis, CSA gives these reported errors:

``` shell
clang: /LLVM/llvm-project/llvm/lib/Support/raw_ostream.cpp:835: virtual size_t llvm::raw_fd_ostream::preferred_buffer_size() const: Assertion `FD >= 0 && "File not yet open!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.  Program arguments: clang --analyze -Xanalyzer -analyzer-checker=debug.ViewExplodedGraph test.c
1.  <eof> parser at end of file
2.  While analyzing stack: 
    #0 Calling main
 #0 0x000055fdf6d446cf llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/bin/clang-16+0x40306cf)
 #1 0x000055fdf6d4266c llvm::sys::CleanupOnSignal(unsigned long) (/usr/local/bin/clang-16+0x402e66c)
 #2 0x000055fdf6c8f9d8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007fac8107c420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fac80b6700b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #5 0x00007fac80b46859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #6 0x00007fac80b46729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
 #7 0x00007fac80b57fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #8 0x000055fdf6d199fe llvm::raw_fd_ostream::preferred_buffer_size() const (/usr/local/bin/clang-16+0x40059fe)
 #9 0x000055fdf6d19f9b llvm::raw_ostream::SetBuffered() (/usr/local/bin/clang-16+0x4005f9b)
#10 0x000055fdf6d1b3a1 llvm::raw_ostream::write(char const*, unsigned long) (/usr/local/bin/clang-16+0x40073a1)
#11 0x000055fdf8965ed9 (anonymous namespace)::ExplodedGraphEmiter::checkEndAnalysis(clang::ento::ExplodedGraph&, clang::ento::BugReporter&, clang::ento::ExprEngine&) const (.isra.0) ExplodedGraphEmitChecker.cpp:0:0
#12 0x000055fdf8eca52f clang::ento::CheckerManager::runCheckersForEndAnalysis(clang::ento::ExplodedGraph&, clang::ento::BugReporter&, clang::ento::ExprEngine&) (/usr/local/bin/clang-16+0x61b652f)
#13 0x000055fdf8f03ce4 clang::ento::ExprEngine::processEndWorklist() (/usr/local/bin/clang-16+0x61efce4)
#14 0x000055fdf8edd9d8 clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (/usr/local/bin/clang-16+0x61c99d8)
#15 0x000055fdf890cbcf (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*, void>>*) AnalysisConsumer.cpp:0:0
#16 0x000055fdf89328d2 (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int) AnalysisConsumer.cpp:0:0
#17 0x000055fdf8933b62 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) AnalysisConsumer.cpp:0:0
#18 0x000055fdf9050635 clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/bin/clang-16+0x633c635)
#19 0x000055fdf7930b89 clang::FrontendAction::Execute() (/usr/local/bin/clang-16+0x4c1cb89)
#20 0x000055fdf78b771e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/bin/clang-16+0x4ba371e)
#21 0x000055fdf7a179c3 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/bin/clang-16+0x4d039c3)
#22 0x000055fdf41db4ed cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/bin/clang-16+0x14c74ed)
#23 0x000055fdf41d7607 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#24 0x000055fdf771f8a9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#25 0x000055fdf6c8fec0 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/local/bin/clang-16+0x3f7bec0)
#26 0x000055fdf772015f clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#27 0x000055fdf76e893c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/local/bin/clang-16+0x49d493c)
#28 0x000055fdf76e93bd clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/local/bin/clang-16+0x49d53bd)
#29 0x000055fdf76f258c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/local/bin/clang-16+0x49de58c)
#30 0x000055fdf41d9c52 clang_main(int, char**) (/usr/local/bin/clang-16+0x14c5c52)
#31 0x00007fac80b48083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#32 0x000055fdf41d22ee _start (/usr/local/bin/clang-16+0x14be2ee)
clang-16: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 16.0.0 (https://github.com/llvm/llvm-project.git 97a1c98f8e38698bdd861dfd69301d2e11e89863)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-16: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/test-db7c74.c
clang-16: note: diagnostic msg: /tmp/test-db7c74.sh
clang-16: note: diagnostic msg: 

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

```
Actually, the clang frontend issue occurs no matter what source program I use for testing and no matter what debug checker I choose. Even if simple command like `clang --analyze test.c` failed with this. I suspect there is an error in my compiled environment, but I don't know how to troubleshoot it. As a beginner, I can't quite understand the valid information in the error report.

I compiled and installed llvm by cloning the latest (last December) llvm-project from this repository and then using the following code.

``` shell
cd llvm-project
mkdir build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
../llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;openmp;lldb;lld"
make
make install
```
---

Environment: 
- ubuntu 20.04
- x86-64

Background: 
I compiled and installed clang manually through the tutorial on the llvm website, which means I have installed the necessary packages such as `build-essential` .

I really want to know how to eliminate this problem.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWltz27iS_jX0S5dUJCjx8uAHWZITzzoTl-2Z2X1SgWBTwjEIcAHQlufXbwGkbFKREzs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