[llvm-bugs] [Bug 44832] New: Assertion `I && "decl not found in linked list"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 7 10:54:54 PST 2020


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

            Bug ID: 44832
           Summary: Assertion `I && "decl not found in linked list"'
                    failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: changochen1 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

POC:
---
a ( struct {        enum b {       c = (struct d
---

Run script:
---
# Crash reproducer for clang version 11.0.0
(https://github.com/llvm/llvm-project.git
56b7f595d2b402ff177ca42214325c8fdea10fb0)
# Driver args: "-x" "c" "-o" "tmp" "test1.c"
# Original command:  "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1"
"-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-resource-dir"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0" "-internal-isystem"
"/usr/local/include" "-internal-isystem"
"/data/rxz226/llvm-project/bld/lib/clang/11.0.0/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-fdebug-compilation-dir" "/home/rxz226/c_reduce"
"-ferror-limit" "19" "-fmessage-length" "0" "-fgnuc-version=4.2.1"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics"
"-faddrsig" "-o" "/tmp/test1-45ae3e.o" "-x" "c" "test1.c"
 "/data/rxz226/llvm-project/bld/bin/clang-11" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-main-file-name" "test1.c" "-mrelocation-model" "static" "-mthread-model"
"posix" "-mframe-pointer=all" "-fmath-errno" "-fno-rounding-math"
"-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-dwarf-column-info" "-fno-split-dwarf-inlining"
"-debugger-tuning=gdb" "-ferror-limit" "19" "-fmessage-length" "0"
"-fgnuc-version=4.2.1" "-fobjc-runtime=gcc" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-faddrsig" "-x" "c" "test1-382bb6.c"
---

Stack dump:
---
clang: /home/rxz226/llvm-project/clang/lib/AST/DeclBase.cpp:1458: void
clang::DeclContext::removeDecl(clang::Decl*): Assertion `I && "decl not found
in linked list"' failed.
Stack dump:
0.      Program arguments: /home/rxz226/llvm-project/bld/bin/clang -x c -o tmp
test1.c
1.      test1.c:1:51: current parser token ''
 #0 0x000000000511679b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:0
 #1 0x000000000511682e PrintStackTraceSignalHandler(void*)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:625:0
 #2 0x00000000051145b6 llvm::sys::RunSignalHandlers()
/home/rxz226/llvm-project/llvm/lib/Support/Signals.cpp:68:0
 #3 0x0000000005115fd7 llvm::sys::CleanupOnSignal(unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/Unix/Signals.inc:361:0
 #4 0x000000000501be1f (anonymous
namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:80:0
 #5 0x000000000501c2fe CrashRecoverySignalHandler(int)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:362:0
 #6 0x00007fee439ba390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
 #7 0x00007fee426c9428 raise
/build/glibc-LK5gWL/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
 #8 0x00007fee426cb02a abort /build/glibc-LK5gWL/glibc-2.23/stdlib/abort.c:91:0
 #9 0x00007fee426c1bd7 __assert_fail_base
/build/glibc-LK5gWL/glibc-2.23/assert/assert.c:92:0
#10 0x00007fee426c1c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#11 0x0000000008c095a7 clang::DeclContext::removeDecl(clang::Decl*)
/home/rxz226/llvm-project/clang/lib/AST/DeclBase.cpp:1459:0
#12 0x0000000007c5038d clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) /home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:9095:0
#13 0x0000000007c42449 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:5733:0
#14 0x0000000007c40ecb clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&)
/home/rxz226/llvm-project/clang/lib/Sema/SemaDecl.cpp:5407:0
#15 0x0000000007a1f217
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.cpp:2290:0
#16 0x0000000007a1e882 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/rxz226/llvm-project/clang/lib/Parse/ParseDecl.cpp:2129:0
#17 0x00000000079ff6cd
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:1110:0
#18 0x00000000079ff7ab
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:1125:0
#19 0x00000000079fec86
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:945:0
#20 0x00000000079fdf00
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:696:0
#21 0x00000000079fd881
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/rxz226/llvm-project/clang/lib/Parse/Parser.cpp:564:0
#22 0x00000000079f97d7 clang::ParseAST(clang::Sema&, bool, bool)
/home/rxz226/llvm-project/clang/lib/Parse/ParseAST.cpp:157:0
#23 0x0000000005c0bed1 clang::ASTFrontendAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1044:0
#24 0x00000000064f371e clang::CodeGenAction::ExecuteAction()
/home/rxz226/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1177:0
#25 0x0000000005c0b820 clang::FrontendAction::Execute()
/home/rxz226/llvm-project/clang/lib/Frontend/FrontendAction.cpp:940:0
#26 0x0000000005ba0092
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/rxz226/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:965:0
#27 0x0000000005d7818e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/rxz226/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:0
#28 0x000000000272848c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/rxz226/llvm-project/clang/tools/driver/cc1_main.cpp:239:0
#29 0x000000000271d97a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/home/rxz226/llvm-project/clang/tools/driver/driver.cpp:328:0
#30 0x0000000005aa1824
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::'lambda'()::operator()() const
/home/rxz226/llvm-project/clang/lib/Driver/Job.cpp:402:0
#31 0x0000000005aa1fd1 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::'lambda'()>(long)
/home/rxz226/llvm-project/llvm/include/llvm/ADT/STLExtras.h:110:0
#32 0x000000000501c944 llvm::function_ref<void ()>::operator()() const
/home/rxz226/llvm-project/llvm/include/llvm/ADT/STLExtras.h:126:0
#33 0x000000000501c4e5
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
/home/rxz226/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:397:0
#34 0x0000000005aa19fd
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/rxz226/llvm-project/clang/lib/Driver/Job.cpp:402:0
#35 0x0000000005a57b08
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
/home/rxz226/llvm-project/clang/lib/Driver/Compilation.cpp:182:0
#36 0x0000000005a57e5f
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
/home/rxz226/llvm-project/clang/lib/Driver/Compilation.cpp:233:0
#37 0x0000000005a673ae
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
/home/rxz226/llvm-project/clang/lib/Driver/Driver.cpp:1480:0
#38 0x000000000271e95c main
/home/rxz226/llvm-project/clang/tools/driver/driver.cpp:496:0
#39 0x00007fee426b4830 __libc_start_main
/build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
#40 0x000000000271bfe9 _start
(/home/rxz226/llvm-project/bld/bin/clang+0x271bfe9)
---

-- 
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/20200207/654da498/attachment.html>


More information about the llvm-bugs mailing list