Bug 13004 - Repeatedly calling XPathExpression.evaluate() causes crashes or memory leaks
Summary: Repeatedly calling XPathExpression.evaluate() causes crashes or memory leaks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-07 11:44 PST by Alexey Proskuryakov
Modified: 2007-03-07 20:01 PST (History)
0 users

See Also:


Attachments
test case (will crash) (1.56 KB, text/html)
2007-03-07 11:53 PST, Alexey Proskuryakov
no flags Details
kill Expression::optimize() (25.42 KB, patch)
2007-03-07 13:12 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
kill Expression::optimize() (29.13 KB, patch)
2007-03-07 14:16 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2007-03-07 11:44:40 PST
Also, assertion failures on debug builds. Patch forthcoming.
Comment 1 Alexey Proskuryakov 2007-03-07 11:52:35 PST
Even worse than that - there is a case that causes a crash in release build, too. This seems way more broken than I thought, still investigating...
Comment 2 Alexey Proskuryakov 2007-03-07 11:53:39 PST
Created attachment 13520 [details]
test case (will crash)
Comment 3 Alexey Proskuryakov 2007-03-07 13:12:23 PST
Created attachment 13523 [details]
kill Expression::optimize()

The expression optimization seems pretty much completely broken to me at the moment. Everything from optimize() to isConstant() has major problems (though it could be that I'm misunderstanding the design, of course).  I suggest just removing it.

I have checked that fast/xpath tests take exactly the same time as they did.
Comment 4 Alexey Proskuryakov 2007-03-07 14:16:12 PST
Created attachment 13528 [details]
kill Expression::optimize()

Oops, forgot to include ChangeLogs.
Comment 5 Darin Adler 2007-03-07 15:05:31 PST
Comment on attachment 13528 [details]
kill Expression::optimize()

r=me

If we want to do an optimization like this in the future we should make some performance test cases and make sure they actually get faster.
Comment 6 Sam Weinig 2007-03-07 20:01:10 PST
Landed in r20051.