Firefox 153.0 tab crash on Burmese Wikipedia search results page for သ..
Categories
(Core :: Internationalization, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox-esr153 | --- | affected |
| firefox153 | --- | wontfix |
| firefox154 | --- | fix-optional |
| firefox155 | --- | affected |
| firefox156 | --- | fixed |
People
(Reporter: yorwb4, Assigned: hsivonen, NeedInfo)
References
(Regression)
Details
(Keywords: crash, regression)
Crash Data
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:153.0) Gecko/20100101 Firefox/153.0
Steps to reproduce:
-
Click the search input box on the page containing သ..
Actual results:
- Tab crashes. This does not happen with other input boxes on the same page, nor for search strings not starting with သ or that have more dots.
Expected results:
- It shouldn't have crashed for သ.. either.
Comment 1•16 days ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Address Bar' component, but is not confident enough to move the bug to that component.
Comment 2•16 days ago
|
||
Cannot reproduce, no problem here.
Please follow https://support.mozilla.org/en-US/kb/troubleshoot-firefox-crashes-closing-or-quitting and provide a Crash ID.
I updated to 153.0.1, created a new profile, restarted in Troubleshooting mode, and it still reproduces 100% for me.
Here are some crash-stats links with the crash IDs:
https://crash-stats.mozilla.org/report/index/bp-0c04ef3e-ff41-480c-b4bc-1035d0260730
https://crash-stats.mozilla.org/report/index/bp-949e8258-04b3-4702-83d3-5976f0260730
https://crash-stats.mozilla.org/report/index/bp-13b9fe45-e739-4228-98ae-fea520260730
https://crash-stats.mozilla.org/report/index/bp-d1529a3d-d777-41a3-a540-45f780260730
https://crash-stats.mozilla.org/report/index/bp-136a3937-169f-4bc3-8d33-75ea20260730
This isn't frontend code — the crash IDs are a Rust bounds-check panic (SmallVec index) inside the vendored ICU4X collator, reached from JS:
icu_collator::elements::CollationElements::look_ahead ← …::next (elements.rs:2082) ← CollatorBorrowed::compare_utf16 ← mozilla_collator_glue_collator_compare_utf16 (js/src/builtin/intl/collator_glue/src/lib.rs:367) ← js::intl::CompareStrings (js/src/builtin/intl/Collator.cpp:707). I.e. Intl.Collator/localeCompare from the page's search-suggestion sorting, with the Burmese (my) tailoring.
Suspected root cause, in third_party/rust/icu_collator/src/elements.rs:
look_ahead()(1516-1540) documents the assumption thatposgrows one-by-one alongsideself.upcoming, and its guards are equality only (pos + 1 == len,pos == len). Anypos > lensilently falls through to line 1538self.upcoming[pos]and panics — that's the crashing frame.- In
next(), the lookahead cursorlooked_ahead(declared 1962, outside'outer) is never rebased whenupcomingshrinks beneath it: line 2478self.upcoming.drain(..drain_from_upcoming), and then at 2492-2500 themay_have_contracted_starterpath resetsdrain_from_upcoming = 0but leaveslooked_aheadstale,collect_combining()(2499) consumes more ofupcoming, and control re-enters viacontinue 'outer(2458) →'ce32loop→ 2082look_ahead(looked_ahead). With the iterator already exhausted (သ+ two dots + end of input)look_aheadcannot refill, sopos > upcoming.len()→ OOB. This fits the reported specificity: U+101E has no specialce32in the root data but occurs inside the Burmese tailoring's contraction contexts, and the trailing-.-then-EOF shape is what leavesupcomingshort.
Proposed fix (two parts):
- Correctness: rebase the cursor wherever
upcomingis mutated —looked_ahead -= drain_from_upcomingafter the drain at 2478, andlooked_ahead = 0alongsidedrain_from_upcoming = 0at 2498; audit the in-placeupcoming.remove(looked_ahead + i)calls (2129/2134/2151/2156) the same way. - Hardening: make
look_aheadnon-panicking —pos >= self.upcoming.len()instead of==, andself.upcoming.get(pos).cloned(), so a state-machine slip degrades to mis-ordering rather than a web-content-triggerable content-process crash. Line 2466-2469 has a second uncheckedself.upcoming[i]with the same "by construction" comment.
The crate is vendored from hsivonen/icu4x branch gecko (intl/update-icu4x.sh; icu_collator 2.1.1 + 2.3-track changes), so the real fix belongs upstream and should ride a re-vendor, or land temporarily under intl/icu4x-patches/.
Regressed by bug 1937541 ("Migrate collation to ICU4X", f3c156092dba) — new in 153. Note that changeset also routes Places, mozStorage, XSLT sorting and IndexedDB keys through the same collator, so the same panic looks reachable in the parent process; suggest S2 and moving this to Core :: Internationalization (hsivonen) rather than Firefox :: General.
Verification anchors: js/src/tests/non262/Intl/Collator/ (compare.js, collation.js; the migration added root.js/chinese.js/dari.js/…) — a my-locale case belongs there; intl/components/gtest/TestCollator.cpp; upstream third_party/rust/icu_collator/tests/tests.rs.
(Analysis is from reading the source only — not built or run.)
This is an automated analysis result. If this result is incorrect please add a needinfo and feel free to correct the error.
Updated•15 days ago
|
Comment 5•15 days ago
|
||
:hsivonen, since you are the author of the regressor, bug 1937541, could you take a look?
For more information, please visit BugBot documentation.
The info that this code path is reachable from JavaScript via Intl helped me narrow down the possible call sites. Here's a pure-JS minimal reproduction:
new Intl.Collator("my").compare("", "\u102d\u102f\u1037")
While trying to highlight the search suggestion "သန်လျင်မြို့", Wikipedia extracts all possible length-3 substrings to compare against the query, and one of them happens to be this sequence of combining marks that causes a crash even when comparing against the empty string.
I filed an upstream bug report: https://github.com/unicode-org/icu4x/issues/8296
| Assignee | ||
Comment 8•14 days ago
|
||
Thanks. I'll take a look.
Comment 9•14 days ago
|
||
Set release status flags based on info from the regressing bug 1937541
Updated•10 days ago
|
| Assignee | ||
Comment 10•1 day ago
|
||
Upstream issue: https://github.com/unicode-org/icu4x/issues/8296
Comment 12•1 day ago
|
||
Copying crash signatures from duplicate bugs.
Comment 13•18 hours ago
|
||
Updated•16 hours ago
|
Comment 14•14 hours ago
|
||
| bugherder | ||
Comment 15•13 hours ago
|
||
The patch landed in nightly and beta is affected, along with ESR.
:hsivonen, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta and ESR approvals.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox155and the ESR status flag(s) towontfix.
For more information, please visit BugBot documentation.
Description
•