Closed Bug 1664814 Opened 4 years ago Closed 3 years ago

Keyword search containing long HTML code will crash Firefox

Categories

(Firefox :: Address Bar, defect, P3)

80 Branch
defect
Points:
3

Tracking

()

VERIFIED FIXED
93 Branch
Tracking Status
firefox93 --- verified

People

(Reporter: whissi, Assigned: daisuke)

References

Details

(Keywords: perf)

Attachments

(6 files)

Attached image bookmark_w_keyword.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

  1. Create a bookmark and assign a keyword (see attached screenshot).

  2. Now type "<keyword>[SPACE]<Paste HTML code>

Actual results:

Firefox will become unresponsive and needs to be killed.

Expected results:

Of course pasting such a content was a mistake. However, Firefox shouldn't become unresponsive.

(This happened when I copied something from Twitter.com while web development tools where opened. So I copied the complete HTML instead of the selected word).

Attached file html_code.txt

Hey Thomas,
I tried to reproduce this on the latest Nightly 82.0a1 (2020-09-17), beta 81.0 and release 80.0.1 but i can add the html code and firefox won't freeze.

Can you test the issue while in Safe Mode. You can find helpful info here : https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode .

Also a fresh new profile could help. You can find more about creating a new profile here : https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems#w_6-create-a-new-firefox-profile .

If possible, you can test this issue on the nightly build as well. Download the build from : https://www.mozilla.org/en-US/firefox/nightly/all/ .

Flags: needinfo?(whissi)
Attached video ff_kws_freeze.webm

I am also able to reproduce with current Firefox Nightly on Windows. Even on Linux, see the following screencast.

Flags: needinfo?(whissi)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

I can repro. I took a profile using perf (because I can't stop the native profiler as the main thread is hung up), and all of the time seems spent in js::intl_CompareStrings.

Looking at the callers of that Intl.Collator and String.localeCompare, I suspect we're hanging around here in the URL bar code.

Status: UNCONFIRMED → NEW
Component: DOM: Core & HTML → Address Bar
Ever confirmed: true
Keywords: perf
Product: Core → Firefox
Severity: -- → S3
Priority: -- → P3

we should be limiting our lookup to a subset of the string.
other related bugs: Bug 1622321, Bug 1589602

See Also: → 1589602, 1622321
Points: --- → 3
Assignee: nobody → daisuke
Status: NEW → ASSIGNED
Attachment #9236588 - Attachment description: Bug 1664814: Disable heuristic results if the search string is too long. → Bug 1664814: Avoid keyword lookup if the keyword length is too long.
Attachment #9236957 - Attachment description: Bug 1664814: Introduce limits for length of search string tokens. → Bug 1664814: Limit the number of tokens to reduce calculate time.
Attachment #9236588 - Attachment description: Bug 1664814: Avoid keyword lookup if the keyword length is too long. → Bug 1664814: Stop to use regex that identifies string that is uri like.
See Also: → 1726837
Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0822a4287a75
Limit the number of tokens to reduce calculate time. r=adw
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

I've managed to reproduce the issue using a Fx nightly build from 08-04-2020. Please note that the issue does not occur on high end machines (Firefox does lose performance, but never fully hangs).

The issue is verified fixed in Fx93.0a1 on Windows 10 and Ubuntu 20.04. Firefox no longer hangs after pasting the HTML code in the address bar.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: