Skip to content

Instantly share code, notes, and snippets.

@vsrinivas
Created March 25, 2025 02:34
Show Gist options
  • Save vsrinivas/7c058db29d96bfcbbcaf415005783142 to your computer and use it in GitHub Desktop.
Save vsrinivas/7c058db29d96bfcbbcaf415005783142 to your computer and use it in GitHub Desktop.
home/vsrinivas/tmp -ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/attr-7dad78.o -x c attr.c
1. attr.c:4:10: current parser token ';'
2. attr.c:3:34: parsing function body 'main'
3. attr.c:3:34: in compound statement ('{}')
#0 0x00007f7bc85043b1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf043b1)
#1 0x00007f7bc85020fe llvm::sys::RunSignalHandlers() (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf020fe)
#2 0x00007f7bc85048d6 (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf048d6)
#3 0x00007f7bc6e42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f7bcfa88777 clang::Sema::DiagnoseAssignmentResult(clang::Sema::AssignConvertType, clang::SourceLocation, clang::QualType, clang::QualType, clang::Expr*, clang::Sema::AssignmentAction, bool*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x1488777)
#5 0x00007f7bcfa87645 clang::Sema::CheckAssignmentOperands(clang::Expr*, clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation, clang::QualType, clang::BinaryOperatorKind) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x1487645)
#6 0x00007f7bcfa6e49f clang::Sema::CreateBuiltinBinOp(clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x146e49f)
#7 0x00007f7bcfa8bdc5 clang::Sema::BuildBinOp(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x148bdc5)
#8 0x00007f7bcfa5ccf5 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x145ccf5)
#9 0x00007f7bcf0d29d4 clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xad29d4)
#10 0x00007f7bcf0d1719 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xad1719)
#11 0x00007f7bcf0d1579 clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xad1579)
#12 0x00007f7bcf130a16 clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb30a16)
#13 0x00007f7bcf130338 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb30338)
#14 0x00007f7bcf12e5af clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb2e5af)
#15 0x00007f7bcf137280 clang::Parser::ParseCompoundStatementBody(bool) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb37280)
#16 0x00007f7bcf1382b5 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb382b5)
#17 0x00007f7bcf152592 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb52592)
#18 0x00007f7bcf0a6d58 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xaa6d58)
#19 0x00007f7bcf1515ba clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb515ba)
#20 0x00007f7bcf151017 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb51017)
#21 0x00007f7bcf15033a clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb5033a)
#22 0x00007f7bcf14e603 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xb4e603)
#23 0x00007f7bcf08ce2e clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xa8ce2e)
#24 0x00007f7bd027e925 clang::CodeGenAction::ExecuteAction() (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x1c7e925)
#25 0x00007f7bd0cb4ea7 clang::FrontendAction::Execute() (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x26b4ea7)
#26 0x00007f7bd0c27fb6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x2627fb6)
#27 0x00007f7bd0d32e4a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x2732e4a)
#28 0x00005651df4a59e0 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-15/bin/clang+0x139e0)
#29 0x00005651df4a3bab (/usr/lib/llvm-15/bin/clang+0x11bab)
#30 0x00005651df4a39fc clang_main(int, char**) (/usr/lib/llvm-15/bin/clang+0x119fc)
#31 0x00007f7bc6e29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#32 0x00007f7bc6e29e40 call_init ./csu/../csu/libc-start.c:128:20
#33 0x00007f7bc6e29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#34 0x00005651df4a03b5 _start (/usr/lib/llvm-15/bin/clang+0xe3b5)
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 15.0.7
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/attr-741fad.c
clang: note: diagnostic msg: /tmp/attr-741fad.sh
clang: note: diagnostic msg:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment