We're seeing leaks in the XPath parsing code: Leak: 0x18667850 size=32 0x00000001 0x00000006 0x18667b30 0x00000000 .........f{0.... 0x00000000 0x00000000 0xffffffff 0x00000000 ................ Call stack: [thread 39a7]: | 0x0 | start | _start | main | dumpRenderTree | -[NSRunLoop runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | _sendCallbacks | -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] | -[NSURLConnection(NSURLConnectionInternal) _sendDidFinishLoadingCallback] | -[WebLoader connectionDidFinishLoading:] | -[WebSubresourceLoader didFinishLoading] | -[KWQResourceLoader finishWithData:] | -[KWQResourceLoader finishJobAndHandle:] | WebCore::Loader::receivedAllData(WebCore::TransferJob*, NSData*) | WebCore::CachedScript::data(WebCore::DeprecatedArray<char>&, bool) | WebCore::CachedScript::checkNotify() | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::XMLTokenizer::executeScripts() | WebCore::CachedScript::ref(WebCore::CachedObjectClient*) | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::Frame::executeScript(WebCore::Node*, DeprecatedString const&, bool) | WebCore::KJSProxy::evaluate(WebCore::String const&, int, WebCore::String const&, WebCore::Node*) | KJS::Interpreter::evaluate(KJS::UString const&, int, KJS::UChar const*, int, KJS::JSValue*) | KJS::InterpreterImp::evaluate(KJS::UChar const*, int, KJS::JSValue*, KJS::UString const&, int) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::TryNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ForNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::AssignResolveNode::evaluate(KJS::ExecState*) | KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::JSDocumentProtoFunc::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::Document::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathEvaluator::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathExpression::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPath::Parser::parseStatement(WebCore::String const&, int&) | xpathyyparse(void*) | xpathyylex(YYSTYPE*) | WebCore::XPath::Parser::lex(void*) | WebCore::XPath::Parser::nextToken() | WebCore::XPath::Parser::nextTokenInternal() | WebCore::XPath::Parser::lexString() | WebCore::String::String[in-charge](DeprecatedString const&) | operator new(unsigned long) | WTF::fastMalloc(unsigned long) Leak: 0x18667810 size=32 0x015bbe98 0x00000000 0x00000000 0x00000000 .[.............. 0x00000000 0x18667850 0x00000000 0x00000000 .....fxP........ Call stack: [thread 8bbb]: | 0x0 | start | _start | main | dumpRenderTree | -[NSRunLoop runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | _sendCallbacks | -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] | -[NSURLConnection(NSURLConnectionInternal) _sendDidFinishLoadingCallback] | -[WebLoader connectionDidFinishLoading:] | -[WebSubresourceLoader didFinishLoading] | -[KWQResourceLoader finishWithData:] | -[KWQResourceLoader finishJobAndHandle:] | WebCore::Loader::receivedAllData(WebCore::TransferJob*, NSData*) | WebCore::CachedScript::data(WebCore::DeprecatedArray<char>&, bool) | WebCore::CachedScript::checkNotify() | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::XMLTokenizer::executeScripts() | WebCore::CachedScript::ref(WebCore::CachedObjectClient*) | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::Frame::executeScript(WebCore::Node*, DeprecatedString const&, bool) | WebCore::KJSProxy::evaluate(WebCore::String const&, int, WebCore::String const&, WebCore::Node*) | KJS::Interpreter::evaluate(KJS::UString const&, int, KJS::UChar const*, int, KJS::JSValue*) | KJS::InterpreterImp::evaluate(KJS::UChar const*, int, KJS::JSValue*, KJS::UString const&, int) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::TryNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ForNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::AssignResolveNode::evaluate(KJS::ExecState*) | KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::JSDocumentProtoFunc::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::Document::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathEvaluator::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathExpression::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPath::Parser::parseStatement(WebCore::String const&, int&) | xpathyyparse(void*) | operator new(unsigned long) | WTF::fastMalloc(unsigned long) Leak: 0x18667b30 size=16 0x00430041 0x004e0041 0x00440041 0x00010001 .C.A.N.A.D.A.... Call stack: [thread bfffe97b]: | 0x0 | start | _start | main | dumpRenderTree | -[NSRunLoop runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | _sendCallbacks | -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] | -[NSURLConnection(NSURLConnectionInternal) _sendDidFinishLoadingCallback] | -[WebLoader connectionDidFinishLoading:] | -[WebSubresourceLoader didFinishLoading] | -[KWQResourceLoader finishWithData:] | -[KWQResourceLoader finishJobAndHandle:] | WebCore::Loader::receivedAllData(WebCore::TransferJob*, NSData*) | WebCore::CachedScript::data(WebCore::DeprecatedArray<char>&, bool) | WebCore::CachedScript::checkNotify() | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::XMLTokenizer::executeScripts() | WebCore::CachedScript::ref(WebCore::CachedObjectClient*) | WebCore::XMLTokenizer::notifyFinished(WebCore::CachedObject*) | WebCore::Frame::executeScript(WebCore::Node*, DeprecatedString const&, bool) | WebCore::KJSProxy::evaluate(WebCore::String const&, int, WebCore::String const&, WebCore::Node*) | KJS::Interpreter::evaluate(KJS::UString const&, int, KJS::UChar const*, int, KJS::JSValue*) | KJS::InterpreterImp::evaluate(KJS::UChar const*, int, KJS::JSValue*, KJS::UString const&, int) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::TryNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | KJS::DeclaredFunctionImp::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ForNode::execute(KJS::ExecState*) | KJS::BlockNode::execute(KJS::ExecState*) | KJS::SourceElementsNode::execute(KJS::ExecState*) | KJS::ExprStatementNode::execute(KJS::ExecState*) | KJS::AssignResolveNode::evaluate(KJS::ExecState*) | KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) | KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::JSDocumentProtoFunc::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&) | WebCore::Document::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathEvaluator::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPathExpression::createExpression(WebCore::String const&, WebCore::XPathNSResolver*, int&) | WebCore::XPath::Parser::parseStatement(WebCore::String const&, int&) | xpathyyparse(void*) | xpathyylex(YYSTYPE*) | WebCore::XPath::Parser::lex(void*) | WebCore::XPath::Parser::nextToken() | WebCore::XPath::Parser::nextTokenInternal() | WebCore::XPath::Parser::lexString() | WebCore::String::String[in-charge](DeprecatedString const&) | WebCore::StringImpl::StringImpl[in-charge](unsigned short const*, unsigned) | WebCore::StringImpl::init(unsigned short const*, unsigned) | WebCore::newUCharVector(unsigned) | WTF::fastMalloc(unsigned long)
I figured out the problem, and I have a patch to fix it along with some other XPath code cleanup and improvements.
Created attachment 8685 [details] patch
Comment on attachment 8685 [details] patch Looks great! r=me
Created attachment 8693 [details] updated patch (merged with Anders's XPath change)
Comment on attachment 8693 [details] updated patch (merged with Anders's XPath change) r=me
Committed revision 14729.
Mass moving XML DOM bugs to the "DOM" Component.