[llvm-bugs] [Bug 49619] New: Assertion `ContinueAfterFailure && "Shouldn't have kept evaluating on failure."' failed.

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 17 11:38:52 PDT 2021


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

            Bug ID: 49619
           Summary: Assertion `ContinueAfterFailure && "Shouldn't have
                    kept evaluating on failure."' failed.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: natechancellor at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Split off from my initial report in
https://bugs.llvm.org/show_bug.cgi?id=49239. After
https://github.com/llvm/llvm-project/commit/bdf6fbc939646b52af61c0bae7335623a8be59f4,
I see the following crash while compiling mm/gup.c in the 5.4 Linux kernel. A
reduced version from cvise:

$ cat gup.i
__get_user_pages_nr_pages_i;
__get_user_pages_nr_pages() {
  __get_user_pages_nr_pages_i = ({
    while (1)
      ;
    0;
  });
}

$ clang -fsyntax-only gup.i
...
clang:
/home/nathan/cbl/github/tc-build/llvm-project/clang/lib/AST/ExprConstant.cpp:12489:
(anonymous namespace)::DelayedNoteFailureRAII::~DelayedNoteFailureRAII():
Assertion `ContinueAfterFailure && "Shouldn't have kept evaluating on
failure."' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -fsyntax-only gup.i
1.      gup.i:8:1: current parser token '}'
2.      gup.i:2:29: parsing function body '__get_user_pages_nr_pages'
3.      gup.i:2:29: in compound statement ('{}')
 #0 0x0000000002871593 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x2871593)
 #1 0x000000000286f3fe llvm::sys::RunSignalHandlers()
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x286f3fe)
 #2 0x00000000027fcd03 (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
CrashRecoveryContext.cpp:0:0
 #3 0x00000000027fce3e CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
 #4 0x00007f95a7be9960 __restore_rt sigaction.c:0:0
 #5 0x00007f95a76dbef5 raise (/usr/lib/libc.so.6+0x3cef5)
 #6 0x00007f95a76c5862 abort (/usr/lib/libc.so.6+0x26862)
 #7 0x00007f95a76c5747 _nl_load_domain.cold loadmsgcat.c:0:0
 #8 0x00007f95a76d4646 (/usr/lib/libc.so.6+0x35646)
 #9 0x0000000004638107 (anonymous
namespace)::IntExprEvaluator::VisitBinaryOperator(clang::BinaryOperator const*)
ExprConstant.cpp:0:0
#10 0x00000000046054a1 Evaluate(clang::APValue&, (anonymous
namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0
#11 0x00000000046026a1 EvaluateAsRValue((anonymous namespace)::EvalInfo&,
clang::Expr const*, clang::APValue&) ExprConstant.cpp:0:0
#12 0x0000000004602a5c clang::Expr::EvaluateForOverflow(clang::ASTContext
const&) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x4602a5c)
#13 0x0000000003c49ebc clang::Sema::CheckForIntOverflow(clang::Expr*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3c49ebc)
#14 0x0000000003c4a419 clang::Sema::CheckCompletedExpr(clang::Expr*,
clang::SourceLocation, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3c4a419)
#15 0x0000000003fc364d clang::Sema::ActOnFinishFullExpr(clang::Expr*,
clang::SourceLocation, bool, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3fc364d)
#16 0x00000000041cb6f1
clang::Sema::ActOnExprStmt(clang::ActionResult<clang::Expr*, true>, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x41cb6f1)
#17 0x0000000003ae890b
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ae890b)
#18 0x0000000003ae6d21
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ae6d21)
#19 0x0000000003aeffc1 clang::Parser::ParseCompoundStatementBody(bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3aeffc1)
#20 0x0000000003af0ef5 clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3af0ef5)
#21 0x0000000003ac70c2
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ac70c2)
#22 0x0000000003b1a169 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3b1a169)
#23 0x0000000003ac620c
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ac620c)
#24 0x0000000003ac5c65
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ac5c65)
#25 0x0000000003ac48ca
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ac48ca)
#26 0x0000000003ac2e1c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3ac2e1c)
#27 0x0000000003abd26d clang::ParseAST(clang::Sema&, bool, bool)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3abd26d)
#28 0x00000000032e4af0 clang::FrontendAction::Execute()
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x32e4af0)
#29 0x000000000322096a
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x322096a)
#30 0x0000000003386f58
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x3386f58)
#31 0x00000000016f983b cc1_main(llvm::ArrayRef<char const*>, char const*,
void*)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x16f983b)
#32 0x00000000016f7312 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#33 0x00000000030c8b42 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::$_1>(long) Job.cpp:0:0
#34 0x00000000027fcc17
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x27fcc17)
#35 0x00000000030c86a7
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x30c86a7)
#36 0x000000000308d858
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x308d858)
#37 0x000000000308db57
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x308db57)
#38 0x00000000030a60f1
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x30a60f1)
#39 0x00000000016f6b96 main
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x16f6b96)
#40 0x00007f95a76c6b25 __libc_start_main (/usr/lib/libc.so.6+0x27b25)
#41 0x00000000016f3fbe _start
(/home/nathan/cbl/github/tc-build/build/llvm/stage1/bin/clang-13+0x16f3fbe)
clang-13: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
ClangBuiltLinux clang version 13.0.0 (https://github.com/llvm/llvm-project
9998b00c2ecd480c54d3fe806c4011439e41b065)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/nathan/cbl/github/tc-build/build/llvm/stage1/bin
clang-13: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.

-- 
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/20210317/47e25861/attachment.html>


More information about the llvm-bugs mailing list