[llvm-bugs] [Bug 52088] New: Compiler crash on clang 13 va_arg of bool

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 5 19:11:34 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52088

            Bug ID: 52088
           Summary: Compiler crash on clang 13 va_arg of bool
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: remi at qumulo.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

When compiling this simple C program, the compiler crashes on clang 13

int
main()
{
    __builtin_va_arg(ap, _Bool);
}

Stack dump:
0.      Program arguments: /opt/qumulo/env/202110052009/bin/clang-13 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations
-disable-free -disable-llvm-verifier -discard-value-names -main-file-name
temp-0802ec.c -mrelocation-model static -mframe-pointer=all -fmath-errno
-fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64
-tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/remi
-resource-dir /opt/qumulo/env/202110052009/lib/clang/13.0.0 -internal-isystem
/opt/qumulo/env/202110052009/lib/clang/13.0.0/include -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include
-internal-externc-isystem
/opt/qumulo/pkg/glibc/16-glibc_2.27-3ubuntu1-p1-7UGEr9Ed-2.27-3ubuntu1-p1-7UGEr9Ed/include
-internal-externc-isystem
/opt/qumulo/pkg/linux-libc-dev/16-glibc_2.27-3ubuntu1-p1-7UGEr9Ed-4.15.0-159.167/include/x86_64-linux-gnu
-internal-externc-isystem
/opt/qumulo/pkg/linux-libc-dev/16-glibc_2.27-3ubuntu1-p1-7UGEr9Ed-4.15.0-159.167/include
-fdebug-compilation-dir=/home/remi -ferror-limit 19 -fgnuc-version=4.2.1
-fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o
/tmp/temp-0802ec-6e9b44.o -x c /tmp/temp-0802ec.c
1.      /tmp/temp-0802ec.c:4:32: current parser token ';'
2.      /tmp/temp-0802ec.c:3:1: parsing function body 'main'
3.      /tmp/temp-0802ec.c:3:1: in compound statement ('{}')
 #0 0x00000000023cd3c3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/opt/qumulo/env/202110052009/bin/clang-13+0x23cd3c3)
 #1 0x00000000023cb2ee llvm::sys::RunSignalHandlers()
(/opt/qumulo/env/202110052009/bin/clang-13+0x23cb2ee)
 #2 0x00000000023cd86f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f65fed3aae0 __restore_rt sigaction.c:0:0
 #4 0x0000000004491399
clang::ASTContext::GetGVALinkageForVariable(clang::VarDecl const*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x4491399)
 #5 0x0000000003f7ae1d clang::Sema::BuildVAArgExpr(clang::SourceLocation,
clang::Expr*, clang::TypeSourceInfo*, clang::SourceLocation)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3f7ae1d)
 #6 0x0000000003f7a601 clang::Sema::ActOnVAArg(clang::SourceLocation,
clang::Expr*, clang::OpaquePtr<clang::QualType>, clang::SourceLocation)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3f7a601)
 #7 0x0000000003c420d0 clang::Parser::ParseBuiltinPrimaryExpression()
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c420d0)
 #8 0x0000000003c3884c
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c3884c)
 #9 0x0000000003c36341
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool,
clang::Parser::TypeCastState, bool, bool*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c36341)
#10 0x0000000003c34c2c
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c34c2c)
#11 0x0000000003c34b69
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c34b69)
#12 0x0000000003c58a65
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c58a65)
#13 0x0000000003c5861f
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::ParsedAttributesWithRange&)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c5861f)
#14 0x0000000003c56d61
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c56d61)
#15 0x0000000003c5ee91 clang::Parser::ParseCompoundStatementBody(bool)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c5ee91)
#16 0x0000000003c6003d clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c6003d)
#17 0x0000000003be237f
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3be237f)
#18 0x0000000003c0ee6d clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3c0ee6d)
#19 0x0000000003be175d
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3be175d)
#20 0x0000000003be1245
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3be1245)
#21 0x0000000003be0354
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/opt/qumulo/env/202110052009/bin/clang-13+0x3be0354)
#22 0x0000000003bde93d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3bde93d)
#23 0x0000000003bde2d7
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3bde2d7)
#24 0x0000000003bda957 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/qumulo/env/202110052009/bin/clang-13+0x3bda957)
#25 0x0000000002d61217 clang::FrontendAction::Execute()
(/opt/qumulo/env/202110052009/bin/clang-13+0x2d61217)
#26 0x0000000002cd5756
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/qumulo/env/202110052009/bin/clang-13+0x2cd5756)
#27 0x0000000002e0472c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/qumulo/env/202110052009/bin/clang-13+0x2e0472c)
#28 0x00000000014402cd cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/qumulo/env/202110052009/bin/clang-13+0x14402cd)
#29 0x000000000143e678 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#30 0x000000000143e4ec main
(/opt/qumulo/env/202110052009/bin/clang-13+0x143e4ec)
#31 0x00007f65fd7c3a87 __libc_start_main
/work/toolchain/packages/glibc/glibc/csu/../csu/libc-start.c:344:0
#32 0x000000000143b59a _start
(/opt/qumulo/env/202110052009/bin/clang-13+0x143b59a)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211006/914f6888/attachment.html>


More information about the llvm-bugs mailing list