Closed Bug 570842 Opened 13 years ago Closed 13 years ago

Pasting large strings into the location bar hangs Camino for ~5m at 100% CPU


(Camino Graveyard :: Location Bar & Autocomplete, defect)

1.9.2 Branch
Not set


(Not tracked)



(Reporter: alqahira, Assigned: stuart.morgan+bugzilla)




(Keywords: hang, perf)


(2 files)

Attached file Sample
I accidentally pasted the contents of ad_blocking.css into the location bar, and Camino essentially hung for 5min (it was still vaguely responsive, processing an event every minute or so), taking 100% of CPU.

Even though I cleared the location bar string immediately (with Esc) when I saw what I'd pasted, and the location bar did visibly clear, the autocomplete work continued for that ~5mins.

This is trivial to reproduce if you have some bookmarks and history (I have about 1500 of the former and 14 days/6072 of the latter), but it won't reproduce with no history/default bookmarks.

There are probably good arguments for truncating pastes into the location bar (even bookmarklets have better ways of being triggered), so that seems like a reasonable first point of attack on this bug (we already have code to smart-strip spaces on location-bar paste, so presumably this check could just go in there).

I assume this is also a regression from 2.0.x, but I'd have to figure out how to get a useful history into there to test.

I'm not sure whether this really needs to block a1 (it's certainly a pain, but I don't know how easy it is to get confused between having an entire CSS file and a URL on the clipboard :P ), but if we can significantly æmeliorate it easily by just truncating pastes, that sounds like low-hanging fruit.

The "autocomplete doesn't realize when location bar contents change and keeps working anyway" is an ongoing problem; there's evidence of it in several of my other location bar bugs.
Flags: camino2.1a1?
Attached patch fix?Splinter Review
This does two things:
1) Fixes the esc-doesn't-cancel-search bug
2) Bypasses evaluateWithObject:, which is where the sample is showing the time spent, when the search string is too long for a match to be possible.

I'm hoping 2 is enough to fix this since it's more precise than truncating at an arbitrary point, but I don't have a good history base to test with. Can you see if this makes the problem go away (even without hitting esc)? If not, I'll add some truncation.
Assignee: nobody → stuart.morgan+bugzilla
Attachment #452570 - Flags: feedback?(alqahira)
Comment on attachment 452570 [details] [diff] [review]

f+!  It's like butter :-) Can I say you're my hero?
Attachment #452570 - Flags: feedback?(alqahira) → feedback+
Attachment #452570 - Flags: superreview?(mikepinkerton)
Comment on attachment 452570 [details] [diff] [review]

Attachment #452570 - Flags: superreview?(mikepinkerton) → superreview+
Closed: 13 years ago
Resolution: --- → FIXED
Flags: camino2.1a1? → camino2.1a1+
You need to log in before you can comment on or make changes to this bug.