[LLVMbugs] [Bug 23687] New: clang crashes when comparing an atomic_uint

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 28 07:49:19 PDT 2015


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

            Bug ID: 23687
           Summary: clang crashes when comparing an atomic_uint
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anthonin.bonnefoy at securactive.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code make clang crash:

#include <stdatomic.h>

atomic_uint count;

int main(int argc, char *argv[])
{
    return count > 1;
}


clang version 3.6.1 (http://llvm.org/git/clang.git
9fd69610a42900694945c75448efd04373359dff) (http://llvm.org/git/llvm.git
66ad281fb93b92858f443915f7811b16c131d3eb)

The backtrace:

/home/sora/git-repos/llvm/tools/clang/lib/Sema/SemaChecking.cpp:5852: void
{anonymous}::DiagnoseOutOfRangeComparison(clang::Sema&, clang::BinaryOperator*,
clang::Expr*, clang::Expr*, llvm::APSInt, bool): Assertion
`(OtherT->isIntegerType() && ConstantT->isIntegerType()) && "comparison with
non-integer type"' failed.
#0 0x23c9ed1 llvm::sys::PrintStackTrace(_IO_FILE*)
(/home/sora/local/bin/clang-3.6+0x23c9ed1)
#1 0x23ca167 PrintStackTraceSignalHandler(void*)
(/home/sora/local/bin/clang-3.6+0x23ca167)
#2 0x23c8e17 SignalHandler(int) (/home/sora/local/bin/clang-3.6+0x23c8e17)
#3 0x7f6e5fbdc8d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x7f6e5ee1c107 gsignal
/build/glibc-Ir_s5K/glibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f6e5ee1d4e8 abort /build/glibc-Ir_s5K/glibc-2.19/stdlib/abort.c:91:0
#6 0x7f6e5ee15226 __assert_fail_base
/build/glibc-Ir_s5K/glibc-2.19/assert/assert.c:92:0
#7 0x7f6e5ee152d2 (/lib/x86_64-linux-gnu/libc.so.6+0x2e2d2)
#8 0x35c4b3c (anonymous namespace)::DiagnoseOutOfRangeComparison(clang::Sema&,
clang::BinaryOperator*, clang::Expr*, clang::Expr*, llvm::APSInt, bool)
(bin/clang-3.6+0x35c4b3c)
#9 0x35c550a (anonymous namespace)::AnalyzeComparison(clang::Sema&,
clang::BinaryOperator*) (/home/sora/local/bin/clang-3.6+0x35c550a)
#10 0x35c7f96 (anonymous namespace)::AnalyzeImplicitConversions(clang::Sema&,
clang::Expr*, clang::SourceLocation) (/home/sora/local/bin/clang-3.6+0x35c7f96)
#11 0x35c92d4 clang::Sema::CheckImplicitConversions(clang::Expr*,
clang::SourceLocation) (/home/sora/local/bin/clang-3.6+0x35c92d4)
#12 0x35cae38 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool) (/home/sora/local/bin/clang-3.6+0x35cae38)
#13 0x38232c3 clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool, bool)
(/home/sora/local/bin/clang-3.6+0x38232c3)
#14 0x397411b clang::Sema::BuildReturnStmt(clang::SourceLocation, clang::Expr*)
(/home/sora/local/bin/clang-3.6+0x397411b)
#15 0x3973248 clang::Sema::ActOnReturnStmt(clang::SourceLocation, clang::Expr*,
clang::Scope*) (/home/sora/local/bin/clang-3.6+0x3973248)
#16 0x33e9322 clang::Parser::ParseReturnStatement()
(/home/sora/local/bin/clang-3.6+0x33e9322)
#17 0x33e3ed1
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
(/home/sora/local/bin/clang-3.6+0x33e3ed1)
#18 0x33e35ee
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) (/home/sora/local/bin/clang-3.6+0x33e35ee)
#19 0x33e63e0 clang::Parser::ParseCompoundStatementBody(bool)
(/home/sora/local/bin/clang-3.6+0x33e63e0)
#20 0x33e962c clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) (/home/sora/local/bin/clang-3.6+0x33e962c)
#21 0x3377c1b clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/home/sora/local/bin/clang-3.6+0x3377c1b)
#22 0x33885f6 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned
int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/sora/local/bin/clang-3.6+0x33885f6)
#23 0x3376e66
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/sora/local/bin/clang-3.6+0x3376e66)
#24 0x3376f4a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/sora/local/bin/clang-3.6+0x3376f4a)
#25 0x3376684
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/home/sora/local/bin/clang-3.6+0x3376684)
#26 0x3375c0c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/home/sora/local/bin/clang-3.6+0x3375c0c)
#27 0x336eda5 clang::ParseAST(clang::Sema&, bool, bool)
(/home/sora/local/bin/clang-3.6+0x336eda5)
#28 0x25ca3d6 clang::ASTFrontendAction::ExecuteAction()
(/home/sora/local/bin/clang-3.6+0x25ca3d6)
#29 0x29190e1 clang::CodeGenAction::ExecuteAction()
(/home/sora/local/bin/clang-3.6+0x29190e1)
#30 0x25c9e8d clang::FrontendAction::Execute()
(/home/sora/local/bin/clang-3.6+0x25c9e8d)
#31 0x2591b99 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/sora/local/bin/clang-3.6+0x2591b99)
#32 0x26e3d59 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/sora/local/bin/clang-3.6+0x26e3d59)
#33 0x12019e5 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/home/sora/local/bin/clang-3.6+0x12019e5)
#34 0x11f9f8f ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef)
(/home/sora/local/bin/clang-3.6+0x11f9f8f)
#35 0x11fa54d main (/home/sora/local/bin/clang-3.6+0x11fa54d)
#36 0x7f6e5ee08b45 __libc_start_main
/build/glibc-Ir_s5K/glibc-2.19/csu/libc-start.c:321:0
#37 0x11f6ec9 _start (/home/sora/local/bin/clang-3.6+0x11f6ec9)

-- 
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/20150528/07a8a13f/attachment.html>


More information about the llvm-bugs mailing list