Open Quuxplusone opened 7 years ago
test-b1224f.c
Created attachment 18254 C generated file The following command will crash clang-4.0 on ubuntu 16.04 (note that this also crashes 3.8 and 3.9) $ python -c "print('{' * 99999)" > test.c && clang-4.0 test.c Output of the command: test.c:1:1: error: expected identifier or '(' #0 0x00007ffa3a2205e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70e5e8) #1 0x00007ffa3a21e76e llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux- gnu/libLLVM-4.0.so.1+0x70c76e) #2 0x00007ffa3a21e8bc (/usr/lib/x86_64-linux-gnu/libLLVM-4.0.so.1+0x70c8bc) #3 0x00007ffa3ca72390 __restore_rt (/lib/x86_64-linux- gnu/libpthread.so.0+0x11390) #4 0x00000000018e5ed2 clang::Lexer::LexTokenInternal(clang::Token&, bool) (/usr/lib/llvm-4.0/bin/clang+0x18e5ed2) #5 0x000000000194f218 clang::Preprocessor::Lex(clang::Token&) (/usr/lib/llvm- 4.0/bin/clang+0x194f218) #6 0x0000000000d63807 clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63807) #7 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a) #8 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a) #9 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a) #10 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a) #11 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib .... (Recursion output) .... (Recursion output) .... (Recursion output) #255 0x0000000000d63a9a clang::Parser::SkipUntil(llvm::ArrayRef<clang::tok::TokenKind>, clang::Parser::SkipUntilFlags) (/usr/lib/llvm-4.0/bin/clang+0xd63a9a) Stack dump: 0. Program arguments: /usr/lib/llvm-4.0/bin/clang -cc1 -triple x86_64-pc-linux- gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value- names -main-file-name test.c -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 -resource-dir /usr/lib/llvm-4.0/bin/../lib/clang/4.0.0 -internal- isystem /usr/local/include -internal-isystem /usr/lib/llvm- 4.0/bin/../lib/clang/4.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal- externc-isystem /usr/include -fdebug-compilation-dir /tmp -ferror-limit 19 - fmessage-length 174 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor- diagnostics -o /tmp/test-a00671.o -x c test.c 1. <unknown> parser at unknown location 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 4.0.0-svn297204-1~exp1 (branches/release_40) Target: x86_64-pc-linux-gnu
Attached test-b1224f.c (100030 bytes, text/x-csrc): C generated file
test-b1224f.c
(100030 bytes, text/x-csrc)