Closed Bug 1379380 Opened 7 years ago Closed 7 years ago

stylo: Crash while parsing a media query expression in core::str::slice_error_fail

Categories

(Core :: CSS Parsing and Computation, defect, P1)

x86_64
Windows 10
defect

Tracking

()

VERIFIED FIXED
mozilla56
Tracking Status
firefox-esr52 --- unaffected
firefox54 --- unaffected
firefox55 --- unaffected
firefox56 --- fixed

People

(Reporter: past, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

This bug was filed from the Socorro interface and is 
report bp-2abff06f-d969-4ba5-845b-a98410170708.
=============================================================

I get this crash consistently when visiting the Paypal checkout page from my local supermarket website (http://e-fresh.gr/). The page loads fine without stylo enabled.
Panos, are you able to get the style sheet URL that we crash on?  In a debug build, when we crash, up on the mozilla::ServoStyleSheet::ParseSheet stack frame, aSheetURI is the sheet URL.  If the sheet can't be downloaded outside of the checkout process for some reason, could you dump out the contents of aInput (which is the style sheet text)?  Thanks!
Flags: needinfo?(past)
I can repro with https://demo.paypal.com. will investigate.
Assignee: nobody → emilio+bugs
so the media query string we're testing looks like:

"screen�\345\345\345\345\345\345\345self-hosted\000"

so in starts_with_ignore_ascii_case(feature_name, "-webkit-"), we index that from 0 to 8 bytes, and that happens to be in the middle of a unicode code-point, so rust panics because the resulting string is not utf-8.
Minimal test-case:

<style>
@media (aaaaa
Oh, bugzilla... Anyway, will add a crashtest along the patch.
I ended up just adding an unit test: https://github.com/servo/servo/pull/17640
(In reply to Emilio Cobos Álvarez [:emilio] from comment #5)
> Oh, bugzilla... Anyway, will add a crashtest along the patch.

Sounds like bugzilla have some issue with your example :)

Consider filing a bug to bugzilla?
Flags: needinfo?(past)
I can do the whole checkout process in a build with https://hg.mozilla.org/integration/autoland/rev/2ed937c5e72c, so marking this as fixed. Please verify it in the next nightly if possible, thanks!

(In reply to Xidorn Quan [:xidorn] UTC+10 from comment #7)
> (In reply to Emilio Cobos Álvarez [:emilio] from comment #5)
> > Oh, bugzilla... Anyway, will add a crashtest along the patch.
> 
> Sounds like bugzilla have some issue with your example :)
> 
> Consider filing a bug to bugzilla?

Filed, bug 1379423.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Crash Signature: [@ core::str::slice_error_fail] → [@ core::str::slice_error_fail] [@ mozalloc_abort | abort | core::str::slice_error_fail]
Priority: -- → P1
Summary: Crash while parsing a media query expression in core::str::slice_error_fail → stylo: Crash while parsing a media query expression in core::str::slice_error_fail
Target Milestone: --- → mozilla56
Confirmed on the same website that the crash no longer occurs.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.