forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support for partial minos (right and/or left bound) #1
Comments
beniz
pushed a commit
that referenced
this issue
Sep 18, 2014
With the unique_ptr, we were crash due to the held over reference described below. Trying to move the m_ExternalSemaSource deletion after the m_IncrParser deletion also leads to crash due to the double deletion (once by the ASTContext, once by m_ExternalSemaSource) of the ExternalSemaSource. If m_Callbacks is declared after m_IncrParser, it will be deleted first and if m_ExternalSemaSource is a unique_ptr, it willbe deleted before m_IncrParser is delete. During the Incremental parser deletion, there is a call to CodeGenModule::Release, then EmitTargetMetdata is called and it tries to get the most recent decl which calls clang::LazyGenerationalUpdatePtr<...>::get which has a LazyVal which has a cached pointer to the AST external source. So this placement is necessary to solve a tear down crash. #0 clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428 428 (LazyVal->ExternalSource->*Update)(O); (gdb) l 423 /// Get the value of this pointer, updating its owner if necessary. 424 T get(Owner O) { 425 if (LazyData *LazyVal = Value.template dyn_cast<LazyData*>()) { 426 if (LazyVal->LastGeneration != LazyVal->ExternalSource->getGeneration()) { 427 LazyVal->LastGeneration = LazyVal->ExternalSource->getGeneration(); 428 (LazyVal->ExternalSource->*Update)(O); 429 } 430 return LazyVal->LastValue; 431 } 432 return Value.template get<T>(); #0 clang::LazyGenerationalUpdatePtr<clang::Decl const*, clang::Decl*, &(clang::ExternalASTSource::CompleteRedeclChain(clang::Decl const*))>::get (this=0x7fff5fbfe0e0, O=0x1069c3f90) at ExternalASTSource.h:428 #1 0x000000010005ce38 in clang::Redeclarable<clang::FunctionDecl>::DeclLink::getNext (this=0x1069c3ff0, D=0x1069c3f90) at Redeclarable.h:74 #2 0x000000010005cd81 in clang::Redeclarable<clang::FunctionDecl>::getNextRedeclaration (this=0x1069c3ff0) at Redeclarable.h:119 #3 0x000000010005d0b3 in clang::Redeclarable<clang::FunctionDecl>::getMostRecentDecl (this=0x1069c3ff0) at Redeclarable.h:161 #4 0x000000010137bfdc in clang::FunctionDecl::getMostRecentDeclImpl (this=0x1069c3f90) at Decl.h:1568 #5 0x00000001004b5346 in clang::Decl::getMostRecentDecl (this=0x1069c3f90) at DeclBase.h:806 #6 0x0000000100897128 in clang::CodeGen::CodeGenModule::EmitTargetMetadata (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3271 #7 0x0000000100895237 in clang::CodeGen::CodeGenModule::Release (this=0x10689aa00) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/CodeGenModule.cpp:395 #8 0x0000000100981b3c in clang::CodeGeneratorImpl::ReleaseModule (this=0x106506d70) at /Users/pcanal/root_working/code/rootcling/interpreter/llvm/src/tools/clang/lib/CodeGen/ModuleBuilder.cpp:82 #9 0x00000001001c3f88 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:168 #10 0x00000001001c3f25 in ~IncrementalParser (this=0x1065047e0) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/IncrementalParser.cpp:166 #11 0x00000001001d8905 in std::__1::default_delete<cling::IncrementalParser>::operator() () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2426 root-project#12 0x00000001001d8905 in ~unique_ptr [inlined] () at /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/memory:2625 root-project#13 0x00000001001d8905 in ~Interpreter (this=0x7fff5fbff020) at memory:2593 root-project#14 0x00000001001d8355 in ~Interpreter (this=0x7fff5fbff020) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/lib/Interpreter/Interpreter.cpp:229 root-project#15 0x00000001002b0318 in main (argc=1, argv=0x7fff5fbff740) at /Users/pcanal/root_working/code/rootcling/interpreter/cling/tools/driver/cling.cpp:97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: