[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User mst changed the following: What|Old value |New value Attachment is patch| |Created an attachment (id= | |75497) fix leaks caused by | | CNode::get --- Additional comments from m...@openoffice.org Fri Jan 7 18:15:07 + 2011 --- Created an attachment (id=75497) fix leaks caused by CNode::get - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 --- Additional comments from m...@openoffice.org Fri Jan 7 18:12:58 + 2011 --- @zhangjfibm: sorry for the delay, was busy with other things, until i forgot about this :( i can confirm the problem that saving a document will then leak the CDocument instance. this was caused by the serialization methods creating new CNodes, but not freeing them. i have a fix for this, and will attach it here. regarding your concerns: 1. the libxml documentation says: "Free a node, this is a recursive behaviour, all the children are freed too." so there should be no problem. 2. the CNodes are stored in a global map, but the map does not retain the CNodes. as soon as all clients of a CNode release it, it will be freed and removed from the global map. if a node for the same m_aNodePtr is needed later, a new CNode will be created. so it is perfectly normal that you see several CNodes being created with the same m_aNodePtr. this is only an error if they are alive at the _same_ time. such a problem did not occur to me so far. - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 --- Additional comments from zhangjf...@openoffice.org Fri Aug 6 05:39:15 + 2010 --- Created an attachment (id=70981) sample file for multi CNode problem - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 --- Additional comments from zhangjf...@openoffice.org Fri Aug 6 05:37:27 + 2010 --- Thank you for your quick fix. Since I only have 31M11 build environment, so I migrate the 3 patches' code to my code base and try a new build, the result is, . open/close an odt document, the CDocument object is freed normally . open/save/close an odt doc, the CDocument object is not freed. The removed child nodes do get freed. I guess there are still some attribute nodes are not freed. I am not sure if I missed something, please help to check it in your environment. There are several concerns about the patches, 1. Removing child node means removing a DOM sub tree, we'd also take care of it's children nodes because they in fact are orphaned nodes too. 2. We met a very special cases before. UNOXML creates several CNode for a single libxml DOM node. In that case, if we freed the m_aNodePtr in first CNode, then we may get trouble when freeing the second CNode. This case can be recreated by these steps with OOo 3.1M11 build. . open the attached sample file . Select some text in one table cell, and change it to bold text. . Then save and close the document I am not sure if still can be recreated with 321 code and these patches. - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User mst changed the following: What|Old value |New value CC|''|'cmc' Status|NEW |STARTED --- Additional comments from m...@openoffice.org Thu Aug 5 12:13:12 + 2010 --- @zhangjfibm, cmc: does the first patch fix the problem? it introduces a new flag to track if a node is removed, and in the CNode dtor, if the flag is set, free the node. i've also attached a second patch: according to the documentation xmlRemoveProp will free the attribute node, so it's a bad idea to retain a pointer to the freed node. oh, and i've just filed some more issues about obvious defects in the unoxml DOM code that i couldn't fail to notice while working on this issue: issue 113681, issue 113682, issue 113683 - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User mst changed the following: What|Old value |New value Attachment is patch| |Created an attachment (id= | |70972) fix another problem | | with xmlRemoveProp --- Additional comments from m...@openoffice.org Thu Aug 5 11:54:14 + 2010 --- Created an attachment (id=70972) fix another problem with xmlRemoveProp - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User mst changed the following: What|Old value |New value Attachment is patch| |Created an attachment (id= | |70971) fix the problem --- Additional comments from m...@openoffice.org Thu Aug 5 11:52:23 + 2010 --- Created an attachment (id=70971) fix the problem - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User mst changed the following: What|Old value |New value Assigned to|mba |mst Ever confirmed| |1 Status|UNCONFIRMED |NEW Target milestone|--- |OOo 3.x --- Additional comments from m...@openoffice.org Thu Aug 5 11:44:41 + 2010 --- mine - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 User zhangjfibm changed the following: What|Old value |New value Issue type|PATCH |DEFECT --- Additional comments from zhangjf...@openoffice.org Thu Aug 5 01:25:20 + 2010 --- update issue type to defect. - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org
[framework-issues] [Issue 113663] unoxml: The libxml dom no des of any removed UNOXML child nodes are not freed
To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=113663 Issue #|113663 Summary|unoxml: The libxml dom nodes of any removed UNOXML chi |ld nodes are not freed Component|framework Version|OOO320m11 Platform|All URL| OS/Version|All Status|UNCONFIRMED Status whiteboard| Keywords| Resolution| Issue type|PATCH Priority|P3 Subcomponent|code Assigned to|mba Reported by|zhangjfibm --- Additional comments from zhangjf...@openoffice.org Thu Aug 5 01:24:36 + 2010 --- The problem is not so serious with normal usages, but it's solution may related with http://www.openoffice.org/issues/show_bug.cgi?id=112783. Please also take a look. To repeat the problem, just simply open any odf document, then save and close it. When saving the odf document, to update some ODF meta data, DOM::CElement::removeChild() is called, so several unoxml dom CNode are removed from the dom tree. Below is the callstack when it happens, unoxmlmi.dll!DOM::CNode::removeChild(const com::sun::star::uno::Reference & oldChild={...}) Line 715 C++ unoxmlmi.dll!DOM::CElement::removeChild(const com::sun::star::uno::Reference & oldChild={...}) Line 274 + 0x11C++ > sfxmi.dll!`anonymous namespace'::SfxDocumentMetaData::setMetaList(const > char * i_name=0x01ba5154, const com::sun::star::uno::Sequence & i_rValue={...}, const _STL::vector<_STL::vector<_STL::pair,_STL::allocator<_STL::pair > >,_STL::allocator<_STL::vector<_STL::pair,_STL::allocator<_STL::pair > > > > * i_pAttrs=0x0185b6fc) Line 875 + 0x41 C++ sfxmi.dll!`anonymous namespace'::SfxDocumentMetaData::updateUserDefinedAndAttributes() Line 1056 + 0x16C++ sfxmi.dll!`anonymous namespace'::SfxDocumentMetaData::serialize(const com::sun::star::uno::Reference & i_xHandler={...}, const com::sun::star::uno::Sequence & i_rNamespaces={...}) Line 2311 + 0xc C++ xomi.dll!SvXMLMetaExport::Export() Line 376 + 0x8e C++ For any UNO XML CNode objects that are not removed from the DOM tree, their corresponding libxml DOM nodes will be completely removed by api xmlFreeDoc(m_aDocPtr) in CDocument::~CDocument(), CDocument::~CDocument(){ ... xmlFreeDoc(m_aDocPtr); } But for any removed Childern CNodes, libxml dom tree doesn't have all these nodes, so in fact all these node will leak after the CDocument object released. DOM::CElement::removeChild() may be also called in other cases, such as calling through UNO API :: com :: sun :: star :: xml :: dom :: XNode::removeChild() directly in OOo applications. Our current ugly fix is to identify all removed Child CNode objects in CDocument dtor api, then for each orphaned CNode, call xmlFreeNodeList(). But it seems this fix conflicts with the fix code of http://www.openoffice.org/issues/show_bug.cgi?id=112783, since CDocument won't remember all child CNode objects any more. - Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification - To unsubscribe, e-mail: issues-unsubscr...@framework.openoffice.org For additional commands, e-mail: issues-h...@framework.openoffice.org - To unsubscribe, e-mail: allbugs-unsubscr...@openoffice.org For additional commands, e-mail: allbugs-h...@openoffice.org