[jira] [Created] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
Blair Fonville created XERCESC-2145: --- Summary: indefinite memory allocations using DOMNode::getTextContent() Key: XERCESC-2145 URL: https://issues.apache.org/jira/browse/XERCESC-2145 Project: Xerces-C++ Issue Type: Bug Components: DOM Affects Versions: 3.2.1, 3.1.2 Environment: Windows 10, Visual Studio 2017 Reporter: Blair Fonville Attachments: main.cpp When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = > ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, > 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplemen tationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplemen > tationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplemen tationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = > ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, > 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) > ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) > ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) > ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) > ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) > { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) > { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) > ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > > > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = > ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, > 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Attachment: config.xml > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: config.xml, main.cpp > > > When using Xerces-C++ in a program, which reads (parses) an xml file once > into a DOMDocument, and then accesses the DOMDocument's nodes/elements often > through getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: In a program which reads (parses) an xml file once into a DOMDocument, and then accesses the content of the nodes/elements often, through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} was: When using Xerces-C++ in a program, which reads (parses) an xml file once into a DOMDocument, and then accesses the DOMDocument's nodes/elements often through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: config.xml, main.cpp > > > In a program which reads (parses) an xml file once into a DOMDocument, and > then accesses the content of the nodes/elements often, through > getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Commented] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16427773#comment-16427773 ] Blair Fonville commented on XERCESC-2145: - Maybe it depends on what constitutes a bug. In a program which populates a Document at startup, and then uses the Document forever, it is a memory leak. For instance, in my case I was loading a configuration xml at startup. In a UI thread, the user might change the document's contents. The worker thread therefore routinely reads the nodes the check for modifications to the config (in order to act accordingly). At the end of the program, the config is saved back to the xml file. But at no point is the document freed; why would it be? This would seem like a typical use of xml, and an xml parser. Seems like a bug to me, that the node contents can't be read without leaking memory. > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: config.xml, main.cpp > > > In a program which reads (parses) an xml file once into a DOMDocument, and > then accesses the content of the nodes/elements often, through > getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Updated] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Blair Fonville updated XERCESC-2145: Description: In a program which reads (parses) an xml file once into a DOMDocument, and then accesses the content of the nodes/elements often, through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} I realize that the memory is supposed to be freed when the Document is released, but in a program where the Document is populated at startup, and used forever, this is, for all practical purposes, a memory leak. was: In a program which reads (parses) an xml file once into a DOMDocument, and then accesses the content of the nodes/elements often, through getTextContent(), the heap memory builds indefinitely. For example: {code:java} #include XERCES_CPP_NAMESPACE_USE int main(int argc, char **argv) { XMLPlatformUtils::Initialize(); XMLCh tempStr[100]; XMLString::transcode("LS", tempStr, 99); DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr); DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( DOMImplementationLS::MODE_SYNCHRONOUS, 0); DOMDocument *doc = impl->createDocument(0, 0, 0); doc = parser->parseURI("config.xml"); DOMElement *el = doc->getDocumentElement(); // Heap blows up here while (1) { char *cstr = XMLString::transcode(el->getTextContent()); XMLString::release(&cstr); } // and/or here while (1) { XMLCh *xstr = XMLString::replicate(el->getTextContent()); char *cstr = XMLString::transcode(xstr); XMLString::release(&cstr); XMLString::release(&xstr); } } {code} > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: config.xml, main.cpp > > > In a program which reads (parses) an xml file once into a DOMDocument, and > then accesses the content of the nodes/elements often, through > getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} > I realize that the memory is supposed to be freed when the Document is > released, but in a program where the Document is populated at startup, and > used forever, this is, for all practical purposes, a memory leak. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org
[jira] [Commented] (XERCESC-2145) indefinite memory allocations using DOMNode::getTextContent()
[ https://issues.apache.org/jira/browse/XERCESC-2145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16428556#comment-16428556 ] Blair Fonville commented on XERCESC-2145: - Scott, It worked just as you described. Thank you. I apologize for my oversight. Hopefully future releases will remove getTextContent. It is rather non-intuitive. > indefinite memory allocations using DOMNode::getTextContent() > - > > Key: XERCESC-2145 > URL: https://issues.apache.org/jira/browse/XERCESC-2145 > Project: Xerces-C++ > Issue Type: Bug > Components: DOM >Affects Versions: 3.1.2, 3.2.1 > Environment: Windows 10, Visual Studio 2017 >Reporter: Blair Fonville >Priority: Major > Attachments: config.xml, main.cpp > > > In a program which reads (parses) an xml file once into a DOMDocument, and > then accesses the content of the nodes/elements often, through > getTextContent(), the heap memory builds indefinitely. > For example: > {code:java} > #include > XERCES_CPP_NAMESPACE_USE > int main(int argc, char **argv) > { > XMLPlatformUtils::Initialize(); > XMLCh tempStr[100]; > XMLString::transcode("LS", tempStr, 99); > DOMImplementation *impl = > DOMImplementationRegistry::getDOMImplementation(tempStr); > DOMLSParser *parser = ((DOMImplementationLS*)impl) ->createLSParser( > DOMImplementationLS::MODE_SYNCHRONOUS, 0); > DOMDocument *doc = impl->createDocument(0, 0, 0); > doc = parser->parseURI("config.xml"); > DOMElement *el = doc->getDocumentElement(); > // Heap blows up here > while (1) { > char *cstr = XMLString::transcode(el->getTextContent()); > XMLString::release(&cstr); > } > // and/or here > while (1) { > XMLCh *xstr = XMLString::replicate(el->getTextContent()); > char *cstr = XMLString::transcode(xstr); > XMLString::release(&cstr); > XMLString::release(&xstr); > } > } > {code} > I realize that the memory is supposed to be freed when the Document is > released, but in a program where the Document is populated at startup, and > used forever, this is, for all practical purposes, a memory leak. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org