Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion in ~CallGraphNode "Node deleted while references remain" #26448

Closed
llvmbot opened this issue Jan 8, 2016 · 4 comments
Closed

Assertion in ~CallGraphNode "Node deleted while references remain" #26448

llvmbot opened this issue Jan 8, 2016 · 4 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 8, 2016

Bugzilla Link 26074
Resolution FIXED
Resolved on Feb 17, 2016 08:59
Version trunk
OS FreeBSD
Blocks #26433
Attachments .cpp, .sh, and .ll showing the assertion
Reporter LLVM Bugzilla Contributor
CC @DimitryAndric,@emaste,@zmodem

Extended Description

I can hit the following assertion while building Firefox on FreeBSD on AArch64:

Assertion failed: (NumReferences == 0 && "Node deleted while references remain"), function ~CallGraphNode, file /usr/src/lib/clang/libllvmipa/../../../contrib/llvm/include/llvm/Analysis/CallGraph.h, line 179.

The attached tar file contains the .sh clang output, a minimized .cpp file, and the lr from this file with no optimization.

@DimitryAndric
Copy link
Collaborator

Minimal command line to reproduce the assertion:

clang -cc1 -triple aarch64-unknown-freebsd -emit-obj Unified_cpp_js_src6-540de0.cpp

Using -triple aarch64-unknown-linux also asserts.

@DimitryAndric
Copy link
Collaborator

Backtrace (don't have any symbols right now):

#​0 0x2b4c47f3 in thr_kill () from /lib/libc.so.7
#​1 0x2b4c47d8 in __raise (s=0) at /usr/src/lib/libc/gen/raise.c:52
#​2 0x2b4c4713 in abort () at /usr/src/lib/libc/stdlib/abort.c:65
#​3 0x2b542a78 in __assert (func=, file=, line=, failedexpr=) at /usr/src/lib/libc/gen/assert.c:51
#​4 0x08ba52b8 in std::__1::__tree<std::__1::__value_type<llvm::Function const*, std::__1::unique_ptr<llvm::CallGraphNode, std::__1::default_deletellvm::CallGraphNode > >, std::__1::__map_value_compare<llvm::Function const*, std::__1::__value_type<llvm::Function const*, std::__1::unique_ptr<llvm::CallGraphNode, std::__1::default_deletellvm::CallGraphNode > >, std::__1::less<llvm::Function const*>, true>, std::__1::allocator<std::__1::__value_type<llvm::Function const*, std::__1::unique_ptr<llvm::CallGraphNode, std::__1::default_deletellvm::CallGraphNode > > > >::erase(std::__1::__tree_const_iterator<std::__1::__value_type<llvm::Function const*, std::__1::unique_ptr<llvm::CallGraphNode, std::__1::default_deletellvm::CallGraphNode > >, std::__1::__tree_node<std::__1::__value_type<llvm::Function const*, std::__1::unique_ptr<llvm::CallGraphNode, std::__1::default_deletellvm::CallGraphNode > >, void*>, int>) ()
#​5 0x08ba2d12 in llvm::CallGraph::removeFunctionFromModule(llvm::CallGraphNode
) ()
#​6 0x08fe6691 in llvm::Inliner::removeDeadFunctions(llvm::CallGraph&, bool) ()
#​7 0x08fe5d97 in llvm::Inliner::doFinalization(llvm::CallGraph&) ()
#​8 0x09c67d77 in (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) ()
#​9 0x08f4f067 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#​10 0x08f4f6f8 in llvm::legacy::PassManager::run(llvm::Module&) ()
#​11 0x09431a9c in clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*, std::__1::unique_ptr<llvm::FunctionInfoIndex, std::__1::default_deletellvm::FunctionInfoIndex >) ()
#​12 0x09b2dcd8 in clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#​13 0x09edd175 in clang::ParseAST(clang::Sema&, bool, bool) ()
#​14 0x097c8526 in clang::ASTFrontendAction::ExecuteAction() ()
#​15 0x09b2c37e in clang::CodeGenAction::ExecuteAction() ()
#​16 0x097c7dc3 in clang::FrontendAction::Execute() ()
#​17 0x09790b3a in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#​18 0x0984a51a in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#​19 0x082f75d0 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()
#​20 0x082f6024 in main ()

@zmodem
Copy link
Collaborator

zmodem commented Feb 16, 2016

Minimal command line to reproduce the assertion:

clang -cc1 -triple aarch64-unknown-freebsd -emit-obj
Unified_cpp_js_src6-540de0.cpp

Using -triple aarch64-unknown-linux also asserts.

This doesn't reproduce for me with trunk or 3.8 Clang. Did it get fixed somehow?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 17, 2016

Fixed in r257279.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants