| Issue |
165671
|
| Summary |
Clang Frontend Unknown Parser Location Bug
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
briankhoi
|
Hello, as a preface I apologize if the format of this bug report is wrong - I tried to read `CONTRIBUTING.md` for help, but was not sure what the exact bug report structure is.
While compiling my program with `make`, I ran into what seems to be a clang frontend bug. Something of note is that this crash seemed to have reverted the most recent line of code written, and when re-typing this line and re-compiling with `make`, the crash did not happen. At this time, I do not feel comfortable sharing the source code used as it is for a university assignment, which heavily builds upon starter code (and thus academic IP) of my current institution. However, I still wanted to help the LLVM project much as I can. If the pure logs do not help without the source code however, then please let me know and I can close the issue.
I have also saved the files generated by the crash needed to reproduce the issue and will reach out to my university for permission.
```
clang -std=c11 -O3 -g -Werror -Wall -Wextra -Wpedantic -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-zero-length-array -DDRIVER -c -o mm-native.o mm.c
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 -std=c11 -O3 -g -Werror -Wall -Wextra -Wpedantic -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-zero-length-array -DDRIVER -c -o mm-native.o mm.c
1. <unknown> parser at unknown location
#0 0x00007f6a8f3c7d01 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3fd01)
#1 0x00007f6a8f3c5a3e llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3da3e)
#2 0x00007f6a8f3c70ab llvm::sys::CleanupOnSignal(unsigned long) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xe3f0ab)
#3 0x00007f6a8f2f3dff (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd6bdff)
#4 0x00007f6a8e06e520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x00007f6a957f4950 clang::Lexer::LexTokenInternal(clang::Token&, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x99a950)
#6 0x00007f6a95857cf4 clang::Preprocessor::Lex(clang::Token&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x9fdcf4)
#7 0x00007f6a95819f5c clang::Preprocessor::CachingLex(clang::Token&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x9bff5c)
#8 0x00007f6a95857d1c clang::Preprocessor::Lex(clang::Token&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x9fdd1c)
#9 0x00007f6a95881c1e clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa27c1e)
#10 0x00007f6a95887af6 clang::Parser::ParseParameterDeclarationClause(clang::DeclaratorContext, clang::ParsedAttributes&, llvm::SmallVectorImpl<clang::DeclaratorChunk::ParamInfo>&, clang::SourceLocation&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa2daf6)
#11 0x00007f6a958857e6 clang::Parser::ParseFunctionDeclarator(clang::Declarator&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa2b7e6)
#12 0x00007f6a95883a68 clang::Parser::ParseDirectDeclarator(clang::Declarator&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa29a68)
#13 0x00007f6a95881c06 clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa27c06)
#14 0x00007f6a95881d60 clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa27d60)
#15 0x00007f6a95876c27 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa1cc27)
#16 0x00007f6a9591e59b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xac459b)
#17 0x00007f6a9591e050 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xac4050)
#18 0x00007f6a9591d4ca clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xac34ca)
#19 0x00007f6a9591bb0d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xac1b0d)
#20 0x00007f6a9585e8dd clang::ParseAST(clang::Sema&, bool, bool) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0xa048dd)
#21 0x00007f6a969d2b71 clang::CodeGenAction::ExecuteAction() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x1b78b71)
#22 0x00007f6a9736eb57 clang::FrontendAction::Execute() (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x2514b57)
#23 0x00007f6a972c63a6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x246c3a6)
#24 0x00007f6a973e845b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x258e45b)
#25 0x000000000041328b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-14/bin/clang+0x41328b)
#26 0x00000000004114bc (/usr/lib/llvm-14/bin/clang+0x4114bc)
#27 0x00007f6a96f44ed2 (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20eaed2)
#28 0x00007f6a8f2f3b6d llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/lib/x86_64-linux-gnu/libLLVM-14.so.1+0xd6bb6d)
#29 0x00007f6a96f449c0 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20ea9c0)
#30 0x00007f6a96f0f183 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20b5183)
#31 0x00007f6a96f0f40a clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20b540a)
#32 0x00007f6a96f29507 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/lib/x86_64-linux-gnu/libclang-cpp.so.14+0x20cf507)
#33 0x0000000000410f26 main (/usr/lib/llvm-14/bin/clang+0x410f26)
#34 0x00007f6a8e055d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#35 0x00007f6a8e055e40 call_init ./csu/../csu/libc-start.c:128:20
#36 0x00007f6a8e055e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#37 0x000000000040e3b5 _start (/usr/lib/llvm-14/bin/clang+0x40e3b5)
clang: error: clang frontend command failed with exit code 135 (use -v to see invocation)
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/mm-b5b62b.c
clang: note: diagnostic msg: /tmp/mm-b5b62b.sh
clang: note: diagnostic msg:
********************
make: *** [Makefile:77: mm-native.o] Error 135
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs