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

    <tr>
        <th>Summary</th>
        <td>
            clang: error: unable to execute command: Segmentation fault (core dumped)
        </td>
    </tr>

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

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

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

<pre>
    When building [z3-sys](https://github.com/prove-rs/z3.rs), bindgen fails because of clang coredumped.

System:

```
Linux station 6.2.0-32-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 10:03:50 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
```

Clang version:

```
Ubuntu clang version 16.0.0 (1~exp5ubuntu3)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```

Stack frames:


```
In file included from /home/mio/web3fuzz/z3.rs/target/debug/build/z3-sys-47c4128756a5754c/out/include/z3.h:23:
In file included from /usr/include/stdio.h:27:
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:
In file included from /usr/include/features.h:487:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:708:1: error: unknown type name 'ne'
error: expected ';' after top level declarator
error: #endif without #if
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 /home/mio/web3fuzz/z3.rs/target/debug/build/z3-sys-47c4128756a5754c/out/include/z3.h
1.      <invalid>: unknown current parser token
 #0 0x00007fc3c85ae6f6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-16/bin/../lib/libLLVM-16.so.1+0xfae6f6)
 #1 0x00007fc3c85ac8e0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-16/bin/../lib/libLLVM-16.so.1+0xfac8e0)
 #2 0x00007fc3c84eba90 (/usr/lib/llvm-16/bin/../lib/libLLVM-16.so.1+0xeeba90)
 #3 0x00007fc3c6e3c4b0 (/lib/x86_64-linux-gnu/libc.so.6+0x3c4b0)
 #4 0x00007fc3cf760d40 clang::Lexer::SkipBlockComment(clang::Token&, char const*, bool&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb60d40)
 #5 0x00007fc3cf76457c clang::Lexer::LexTokenInternal(clang::Token&, bool) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb6457c)
 #6 0x00007fc3cf78e01d clang::Preprocessor::SkipExcludedConditionalBlock(clang::SourceLocation, clang::SourceLocation, bool, bool, clang::SourceLocation) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb8e01d)
 #7 0x00007fc3cf791eca clang::Preprocessor::HandleIfdefDirective(clang::Token&, clang::Token const&, bool, bool) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb91eca)
 #8 0x00007fc3cf79142e clang::Preprocessor::HandleDirective(clang::Token&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb9142e)
 #9 0x00007fc3cf766294 clang::Lexer::LexTokenInternal(clang::Token&, bool) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb66294)
#10 0x00007fc3cf7c8e29 clang::Preprocessor::Lex(clang::Token&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xbc8e29)
#11 0x00007fc3cf78a35c clang::Preprocessor::PeekAhead(unsigned int) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xb8a35c)
#12 0x00007fc3cf894f73 clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(clang::CXXScopeSpec&, bool, clang::ImplicitTypenameContext) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc94f73)
#13 0x00007fc3cf895704 clang::Parser::TryAnnotateTypeOrScopeToken(clang::ImplicitTypenameContext) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc95704)
#14 0x00007fc3cf7e418f clang::Parser::isDeclarationSpecifier(clang::ImplicitTypenameContext, bool) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xbe418f)
#15 0x00007fc3cf7e2ddb clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xbe2ddb)
#16 0x00007fc3cf8929a7 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc929a7)
#17 0x00007fc3cf8923c9 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc923c9)
#18 0x00007fc3cf891667 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc91667)
#19 0x00007fc3cf88fa0e clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc8fa0e)
#20 0x00007fc3cf88f48f clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xc8f48f)
#21 0x00007fc3cf7cf5f5 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0xbcf5f5)
#22 0x00007fc3d13ed825 clang::FrontendAction::Execute() (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x27ed825)
#23 0x00007fc3d1367d54 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x2767d54)
#24 0x00007fc3d1466b04 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x2866b04)
#25 0x0000559b40758fb6 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-16/bin/clang+0x14fb6)
#26 0x0000559b407560f0 (/usr/lib/llvm-16/bin/clang+0x120f0)
#27 0x00007fc3d1043b62 (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x2443b62)
#28 0x00007fc3c84eb82c llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm-16/bin/../lib/libLLVM-16.so.1+0xeeb82c)
#29 0x00007fc3d1043263 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x2443263)
#30 0x00007fc3d100e4e2 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x240e4e2)
#31 0x00007fc3d100e73e clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x240e73e)
#32 0x00007fc3d1028e2d clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib/llvm-16/bin/../lib/libclang-cpp.so.16+0x2428e2d)
#33 0x0000559b40755875 clang_main(int, char**) (/usr/lib/llvm-16/bin/clang+0x11875)
#34 0x00007fc3c6e23a90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#35 0x00007fc3c6e23b49 call_init ./csu/../csu/libc-start.c:128:20
#36 0x00007fc3c6e23b49 __libc_start_main ./csu/../csu/libc-start.c:347:5
#37 0x0000559b40752705 _start (/usr/lib/llvm-16/bin/clang+0xe705)
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Ubuntu clang version 16.0.0 (1~exp5ubuntu3)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: note: diagnostic msg: Error generating preprocessed source(s).
```

Reproduce:

Download the headers: 
[include.tar.gz](https://github.com/llvm/llvm-project/files/12567767/include.tar.gz)

```bash
tar xf include.tar.gz
clang include/z3.h
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUWk1z27iW_TX0BiUVCfBLCy8Y2epxl9Ptit09PSsXCF5KmFAABwAdOYv57a8AUhbByIqTJ3f1q0pFNAlcnHNwcXHxQbXmawFwGSQfguTqgnZmI9XlF1MxWcFFKavny__egEBlx5uKizUKkg9fyUw_6yC5CnC-MabVASkCvArwas3NpivnTG4DvGqVfIKZ0gFefSVz-7sI8BKVXFRrEKimvNGoBEY7DUjWiDVUrBGTCqpu20I1D8KrICz6_--ftYGtbWj0MkjD4Z_785aLboe0oYZLgdI5noczgmdrEKA4QwEmBM_-KDthOnT_8Q7dfbq-_nj38Hj1P78VH2-W6KMUqOjWKIpRFAakCElAiiREfzwsEQ4xQbs8fUzjyc8vv_0R4JVr-yiq_v-lI_cESnMpTtMYELJxDRSl83AeogDn0f_Drk06V4hYTV2lB6rWYAJSDLBmLZs1FtNsLbqhyEYBrdBWVtDYgq3UfIB8I7ShTQPVFVf2U4BXnVYBXpVcnCB1byj7jGpFt6CnnI7VuhGo5g0gLljTVVChWsmtbWwjtxDg1ZbLAK--QEnq7uvXg9-sTM8Oryoou7XFZd3RFbCuOIszFkc4z5KUJlkSswCvZGfLDy31pjYBKTB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