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mz7XJV1r77TywkFFiUdJ_Q8qB8P7YqKGc5TneL3WeZn7i17Dknm6xd6af05lznNZBfKWPy6BrtT56Nc0dHLBzQreVt55QKbkD-wyeIVwd1ZrOzT81kqpCAPcPZuvU7r92cS2tLRZevbcPpSR3l0rOEfvtLbW9loR9TEDmUXq63vebi_vXq8ZbbNqTTkjO5ksCdprBtsWzu38dVJcucjZ2VDWrtQG6qXGTnouTr1V7D-spZqdtdVVwuc0583uP31KjXTTI5NTyiqZhmKS2YFTsAu_MgVQJZk4_0VwK-Pme9785ZUspVspOH9ddIZ8-coQ7KDob83KM8V5nl2ObrYmEVEHgCtyEdPCnW6QBywKJ1NDzce-0utV27cPq95Q5fr8UVxmRZZmvEL3rq1NpdGuo1GzMmL1lSXw_VeQWOb-9uPLmefUxcY_5LC0dnE2lZC8N0EfDm9WF-KVI6LNI0mRRoRpc7wyPMxzycJaiMRXVQ8l5W9hN2jJGnkE_Mi6DpqcnPx8wjUZRKB_OIYT0TFJCyLWSRlGU3SbMJ5mY_GEWoYVe0D-cJcepEU3eislHWHKL9AkCLnpfSAgdApV8nLhQ_0ojX9lSGtWP-viLP_TLjwKC89xP8BWwW2Ew>53116</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Crash during processing of malformed source file
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
retpoline
</td>
</tr>
</table>
<pre>
Hi folks,
A crash was found while fuzz testing of the castxml binary which can be triggered via a very short, malformed source file.
**system info**
```
Ubuntu 20.04 x64
$ clang -v
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
**crash.cxx**
```
;
```
**debug log**
```
(gdb) set environment LD_PRELOAD=/usr/lib/libefence.so
(gdb) r crash.cxx
Starting program: /usr/bin/clang crash.cxx
Electric Fence 2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Electric Fence 2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
[Detaching after vfork from child process 917813]
Electric Fence 2.2 Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
Stack dump:
0. Program arguments: /usr/lib/llvm-10/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name crash.cxx -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib/llvm-10/lib/clang/10.0.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++ -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/x86_64-linux-gnu -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-10/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/test -ferror-limit 19 -fmessage-length 197 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/crash-6e73a6.o -x c++ crash.cxx
#0 0x00007ffff15bc4ff llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x9814ff)
#1 0x00007ffff15ba7b0 llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x97f7b0)
#2 0x00007ffff15bcac5 (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x981ac5)
#3 0x00007ffff7d8c3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007ffff5b9e95f clang::Parser::initializePragmaHandlers() (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x8cf95f)
#5 0x00007ffff5bc67c8 clang::Parser::Parser(clang::Preprocessor&, clang::Sema&, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x8f77c8)
#6 0x00007ffff5b249ff clang::ParseAST(clang::Sema&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x8559ff)
#7 0x00007ffff6f9ae58 clang::FrontendAction::Execute() (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1ccbe58)
#8 0x00007ffff6f538a1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1c848a1)
#9 0x00007ffff6ffedaf clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1d2fdaf)
#10 0x000000000041229d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-10/bin/clang+0x41229d)
#11 0x00000000004105b1 (/usr/lib/llvm-10/bin/clang+0x4105b1)
#12 0x000000000041036d main (/usr/lib/llvm-10/bin/clang+0x41036d)
#13 0x00007ffff07220b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#14 0x000000000040d7ce _start (/usr/lib/llvm-10/bin/clang+0x40d7ce)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
[Detaching after vfork from child process 919294]
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: note: diagnostic msg: Error generating preprocessed source(s).
[Inferior 1 (process 917701) exited with code 0376]
(gdb)
```
Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFWE1v4zgS_TXOhZAgyZZtHXJInGRngAw26PQs9mZQFGVzWhINknLc_ev3FaXYluNOOuntGcMQJH5UPRarXhWZ6-Lr5W-Klbr6YkfJYhTdjKKr7nnFhOF2zZ64RX_bFOxprSrJyvbbN-akdapZMV0yt5ZMcOt2dcVy1XDzlQaKNRoblkvmjFqtpJEF2yrOONtKjLBrbRwUsppXpTY1eq1ujYB46AiPcYwS-tuv1smaqabUXcNgyDTq__7zz7xtXMuSKIwmbDedDKVNmKg4oAfbrqX7AiqrdMNiTAqjYNJ6GTHrxnzmZiXdaHzFdvPpcjoJNiKoVNPuglXT9kPWRvKC1bqQFQ3caKt2XdfvjXW8qmRxowx1jZK71ho8Ya5uxJ23LwxWqII7yf61WGCpfhZ3gPViVnIXhnhUKsdzJQSePbIDrOQujn-p-OwD0n8F4h-D-SgrKRwc7f9s3MUeZN1WTtEsCAxH4-vRJKqfvW-v_bVBJ3587P8-FkOx273p_STzLWmFzNsVq_TqbWnJfFXADhmz0jHZbJXRTS0bx-5vlg-fbu__fXUzGt-c7AWespSNkKHVp3IMO6ylM43jxpPJxuiV4fWZ_ehi9GRe92TslixrlGB3pJElYcIWevMVtLN2EDRfkNY4m8-COMsydm1ajHoAIzWWjcaLnL6xCxvfEgoNALe9hvS6D2tvsBWBbC09sUDne5ZFDqvwHNE9Sm96_vFD1tq64Th8GKLHUZLsLXXGsY7nwH5hjPHh37jkG-m4WNMSeOmk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