PLEASE DO NOT REPLY TO THIS MESSAGE. TO FURTHER COMMENT ON THE STATUS OF THIS BUG PLEASE FOLLOW THE LINK BELOW AND USE THE ON-LINE APPLICATION. REPLYING TO THIS MESSAGE DOES NOT UPDATE THE DATABASE, AND SO YOUR COMMENT WILL BE LOST SOMEWHERE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3422 *** shadow/3422 Tue Sep 4 15:18:33 2001 --- shadow/3422.tmp.29534 Tue Sep 4 15:18:33 2001 *************** *** 0 **** --- 1,128 ---- + +============================================================================+ + | Memory leaks from DTDValidator | + +----------------------------------------------------------------------------+ + | Bug #: 3422 Product: Xerces-C++ | + | Status: NEW Version: 1.5.1 | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: Validating Parser (DTD) | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + Running the debug build of SAXPrint.exe on Windows NT 4.0 with the command line + 'saxprint -v=always personal.xml' appears to expose a memory leak in the DTD + validation layer. This was detected using Purify 6.0: + + [I] Searching for all memory leaks... + [W] MLK: Memory leak of 18 bytes from 1 block allocated in QName::setPrefix(WORD + const*) + [W] MLK: Memory leak of 18 bytes from 1 block allocated in + QName::setLocalPart(WORD const*) + [W] MLK: Memory leak of 24 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 24 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 24 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 28 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 28 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 28 bytes from 1 block allocated in + DFAContentModel::buildSyntaxTree(ContentSpecNode * const) + [W] MLK: Memory leak of 28 bytes from 1 block allocated in + DFAContentModel::buildDFA(ContentSpecNode * const) + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getLastPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 20 bytes from 1 block allocated in + CMNode::getFirstPos(void)const + [W] MLK: Memory leak of 28 bytes from 1 block allocated in + DFAContentModel::buildDFA(ContentSpecNode * const) + + These are likely to be related. Focusing on the last one, the call trace is + + new(UINT) [crtdbg.h:552] + DFAContentModel::buildDFA(ContentSpecNode * const) [DFAContentModel.cpp:460] + DFAContentModel::DFAContentModel(bool,XMLElementDecl * const) + [DFAContentModel.cpp:171] + DTDElementDecl::createChildModel(void) [DTDElementDecl.cpp:406] + DTDElementDecl::makeContentModel(void) [DTDElementDecl.cpp:317] + XMLElementDecl::getContentModel(void) [XMLElementDecl.hpp:639] + DTDValidator::checkContent(XMLElementDecl * const,QName * * const,UINT) + [DTDValidator.cpp:125] + XMLScanner::scanEndTag(bool&) [XMLScanner.cpp:1673] + XMLScanner::scanContent(bool) [XMLScanner.cpp:1502] + XMLScanner::scanDocument(InputSource const&,bool) [XMLScanner.cpp:374] + XMLScanner::scanDocument(WORD const* const,bool) [XMLScanner.cpp:320] + XMLScanner::scanDocument(char const* const,bool) [XMLScanner.cpp:329] + SAXParser::parse(char const* const,bool) [SAXParser.cpp:417] + main [saxprint.cpp:309] + mainCRTStartup [crtexe.c:338] + + and the relevent lines are + + DFAContentModel::buildDFA(ContentSpecNode * const) [DFAContentModel.cpp:460] + // DFA state position and count the number of such leafs, which is left + // in the fLeafCount member. + // + => QName* qname = new QName(XMLUni::fgZeroLenString, + XMLUni::fgZeroLenString, XMLContentModel::gEOCFakeId); + CMLeaf* nodeEOC = new CMLeaf(qname); + CMNode* nodeOrgContent = buildSyntaxTree(curNode); + fHeadNode = new CMBinaryOp + + suggesting that the DFAContentModel is not freeing all the objects it creates. + + ///////////////////////////// + In file 'src/validators/common/DFAContentModel.cpp' + at function 'void DFAContentModel::buildDFA(ContentSpecNode* const curNode)' + at line 460: + + QName* qname = new QName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, + XMLContentModel::gEOCFakeId); + CMLeaf* nodeEOC = new CMLeaf(qname); + delete qname; // The addition of this line remove the QName leaks. + + The remaining problems appear related to a failure to delete the memory + associated with: + + fHeadNode = new CMBinaryOp + ( + ContentSpecNode::Sequence + , nodeOrgContent + , nodeEOC + ); + + Curiously, there is an explicit comment about this + + // the CMBinary will be released by fLeafList[] + //delete fHeadNode; + + which suggests that someone missed a case. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
