Bug: Startup Crash in cssparser
Status: NEW
Priority: --
Created: 2023-12-31 17:47:52+00:00
Resolved: 2024-10-15 14:50:28+00:00

Collectively, 81% of [Thunderbird cssparser crashes](https://crash-stats.mozilla.org/search/?signature=^cssparser&product=Thunderbird&date=>=2023-09-30T01:04:00.000Z&date=<2023-12-31T01:04:00.000Z&_facets=signature&_facets=version&_facets=uptime&_facets=useragent_locale&_sort=-date&_columns=signature#facet-signature) have uptime of 5 seconds or less.

I was surprised to see [Firefox and Fenix have a similar profile](https://crash-stats.mozilla.org/search/?signature=%5Ecssparser&product=Fenix&product=Firefox&date=%3E%3D2023-06-30T17%3A21%3A00.000Z&date=%3C2023-12-31T17%3A21%3A00.000Z&_facets=signature&_facets=version&_facets=uptime&_facets=useragent_locale&_facets=product&_facets=platform&_sort=-date&_columns=signature#facet-platform)

Collectively, for [Thunderbird 115.6.0](https://crash-stats.mozilla.org/search/?signature=%5Ecssparser&product=Thunderbird&version=115.6.0&date=%3E%3D2023-12-23T00%3A00%3A00.000Z&date=%3C2023-12-30T23%3A59%3A00.000Z&_facets=signature&_facets=version&_facets=uptime&_facets=useragent_locale&_facets=product&_facets=platform&_sort=-date&_columns=signature#crash-reports) the [ranking about #90](https://crash-stats.mozilla.org/topcrashers/?product=Thunderbird&version=115.6.0&_facets_size=300)

Surprisingly, for [Firefox esr 115.6.0](https://crash-stats.mozilla.org/search/?signature=%5Ecssparser&product=Firefox&version=115.6.0esr&date=%3E%3D2023-12-23T00%3A00%3A00.000Z&date=%3C2023-12-30T23%3A59%3A00.000Z&_facets=signature&_facets=version&_facets=uptime&_facets=useragent_locale&_facets=product&_facets=platform&_sort=-date&_columns=signature#crash-reports) the [ranking is about #27](https://crash-stats.mozilla.org/topcrashers/?product=Firefox&version=115.6.0esr).

==========

Crash report: https://crash-stats.mozilla.org/report/index/8fcd58af-da59-4158-a69f-dc0950231214 Crash Address	0xffffffff

Reason: ```EXCEPTION_ACCESS_VIOLATION_READ```

Top 10 frames of crashing thread:
```
0  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:672
0  xul.dll  cssparser::parser::parse_until_before  third_party/rust/cssparser/src/parser.rs:1039
0  xul.dll  cssparser::parser::Parser::parse_until_before  third_party/rust/cssparser/src/parser.rs:778
0  xul.dll  style::media_queries::media_list::MediaList::parse  servo/components/style/media_queries/media_list.rs:43
1  xul.dll  geckoservo::glue::Servo_MediaList_SetText::closure$0  servo/ports/geckolib/glue.rs:5021
1  xul.dll  geckoservo::glue::write_locked_arc  servo/ports/geckolib/glue.rs:2038
1  xul.dll  geckoservo::glue::Servo_MediaList_SetText  servo/ports/geckolib/glue.rs:5020
2  xul.dll  mozilla::dom::MediaList::SetTextInternal  layout/style/MediaList.cpp:99
2  xul.dll  mozilla::dom::MediaList::MediaList  layout/style/MediaList.cpp:76
2  xul.dll  mozilla::dom::MediaList::Create  layout/style/MediaList.cpp:86
```

bp-59629f37-bd9e-454c-a1ec-e660a0231220 Crash Address	0x0000005873dfb007

=========

Crash report: https://crash-stats.mozilla.org/report/index/743b9750-cdcd-4b34-bfe6-f340f0231217  Crash Address	0x0000000002e141d2

Reason: ```EXCEPTION_ACCESS_VIOLATION_READ``` 

Top 10 frames of crashing thread:
```
0  xul.dll  cssparser::tokenizer::Tokenizer::state  third_party/rust/cssparser/src/tokenizer.rs:297
0  xul.dll  cssparser::parser::Parser::state  third_party/rust/cssparser/src/parser.rs:503
0  xul.dll  cssparser::parser::Parser::try_parse  third_party/rust/cssparser/src/parser.rs:578
0  xul.dll  style::values::specified::box_::impl$15::parse  servo/components/style/values/specified/box.rs:1102
0  xul.dll  style::properties::generated::longhands::will_change::parse  x86_64-pc-windows-msvc/release/build/style-0e0765f45029c778/out/longhands/box.rs:5659
0  xul.dll  style::properties::generated::longhands::will_change::parse_declared  x86_64-pc-windows-msvc/release/build/style-0e0765f45029c778/out/longhands/box.rs:5709
1  xul.dll  style::properties::generated::LonghandId::parse_value  third_party/rust/cssparser/src/tokenizer.rs:246
1  xul.dll  style::properties::generated::impl$32::parse_into::closure$1::closure$0  x86_64-pc-windows-msvc/release/build/style-0e0765f45029c778/out/properties.rs:51904
1  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:689
1  xul.dll  style::properties::generated::impl$32::parse_into::closure$1  x86_64-pc-windows-msvc/release/build/style-0e0765f45029c778/out/properties.rs:51904
```
==========
Crash report: https://crash-stats.mozilla.org/report/index/1a342a94-3fb7-4c80-842c-496390231220

Reason: ```EXCEPTION_ACCESS_VIOLATION_WRITE```

Top 10 frames of crashing thread:
```
0  xul.dll  core::result::impl$27::from_residual  /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:2065
0  xul.dll  cssparser::parser::Parser::expect_ident_matching  third_party/rust/cssparser/src/parser.rs:344
0  xul.dll  style::values::generics::length::impl$0::parse_with::closure$0  servo/components/style/values/generics/length.rs:61
0  xul.dll  cssparser::parser::Parser::try_parse  third_party/rust/cssparser/src/parser.rs:560
0  xul.dll  enum2$<style::values::generics::length::GenericLengthPercentageOrAuto<enum2$<style::values::specified::length::LengthPercentage> > >::parse_with<enum2$<style::values::specified::length::LengthPercentage>, style::values::specified::length::impl$33::parse_quirky::closure_env$0>  servo/components/style/values/generics/length.rs:61
1  xul.dll  enum2$<style::values::generics::length::GenericLengthPercentageOrAuto<enum2$<style::values::specified::length::LengthPercentage> > >::parse_quirky  servo/components/style/values/specified/length.rs:1639
1  xul.dll  style::properties::generated::shorthands::margin::parse_value::closure$0  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/shorthands/margin.rs:161
1  xul.dll  style::values::generics::rect::impl$1::parse_with::closure$0  servo/components/style/values/generics/rect.rs:58
1  xul.dll  cssparser::parser::Parser::try_parse  third_party/rust/cssparser/src/parser.rs:560
1  xul.dll  style::values::generics::rect::Rect<enum2$<style::values::generics::length::GenericLengthPercentageOrAuto<enum2$<style::values::specified::length::LengthPercentage> > > >::parse_with  servo/components/style/values/generics/rect.rs:58
```
========
Crash report: https://crash-stats.mozilla.org/report/index/2f417b8a-6fc0-448e-82ad-319670231225

Reason: ```EXCEPTION_ACCESS_VIOLATION_READ```

Top 10 frames of crashing thread:
```
0  xul.dll  cssparser::parser::Parser::state  third_party/rust/cssparser/src/parser.rs:483
0  xul.dll  cssparser::parser::Parser::try_parse  third_party/rust/cssparser/src/parser.rs:559
0  xul.dll  style::values::specified::svg::impl$0::parse  servo/components/style/values/specified/svg.rs:76
0  xul.dll  style::properties::generated::longhands::stroke_dasharray::parse  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/longhands/inherited_svg.rs:1639
0  xul.dll  style::properties::generated::longhands::stroke_dasharray::parse_declared  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/longhands/inherited_svg.rs:1684
1  xul.dll  style::properties::generated::LonghandId::parse_value  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/properties.rs:43141
1  xul.dll  style::properties::generated::impl$31::parse_into::closure$1::closure$0  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/properties.rs:50670
1  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:670
1  xul.dll  style::properties::generated::impl$31::parse_into::closure$1  x86_64-pc-windows-msvc/release/build/style-18ad46f4c78c0e84/out/properties.rs:50670
1  xul.dll  enum2$<core::result::Result<enum2$<style::properties::generated::PropertyDeclaration>, tuple$<> > >::or_else  /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1411
```
========
Crash report: https://crash-stats.mozilla.org/report/index/bbce6f20-0081-4d9d-a3b9-1e44c0231211

Reason: ```EXCEPTION_ACCESS_VIOLATION_WRITE```

Top 10 frames of crashing thread:
```
0  xul.dll  cssparser::tokenizer::Tokenizer::reset  third_party/rust/cssparser/src/tokenizer.rs:310
0  xul.dll  cssparser::parser::Parser::reset  third_party/rust/cssparser/src/parser.rs:522
0  xul.dll  cssparser::parser::Parser::expect_exhausted  third_party/rust/cssparser/src/parser.rs:395
0  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:671
0  xul.dll  cssparser::parser::parse_nested_block  third_party/rust/cssparser/src/parser.rs:1112
0  xul.dll  cssparser::parser::Parser::parse_nested_block  third_party/rust/cssparser/src/parser.rs:758
0  xul.dll  cssparser::parser::Parser::expect_url_or_string  third_party/rust/cssparser/src/parser.rs:883
1  xul.dll  style::stylesheets::rule_parser::impl$2::parse_prelude  servo/components/style/stylesheets/rule_parser.rs:267
1  xul.dll  cssparser::rules_and_declarations::parse_at_rule::closure$0  third_party/rust/cssparser/src/rules_and_declarations.rs:457
1  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:670
```
========
Crash report: https://crash-stats.mozilla.org/report/index/69808e3a-a625-4a07-8d73-b1af30231230

Reason: ```EXCEPTION_IN_PAGE_ERROR_EXEC / STATUS_INVALID_DEVICE_REQUEST```

Top 10 frames of crashing thread:
```
0  xul.dll  cssparser::parser::Parser::expect_exhausted  third_party/rust/cssparser/src/parser.rs:385
0  xul.dll  cssparser::parser::Parser::parse_entirely  third_party/rust/cssparser/src/parser.rs:671
0  xul.dll  cssparser::parser::parse_until_before  third_party/rust/cssparser/src/parser.rs:1039
0  xul.dll  cssparser::parser::Parser::parse_until_before  third_party/rust/cssparser/src/parser.rs:778
0  xul.dll  cssparser::parser::parse_until_after  third_party/rust/cssparser/src/parser.rs:1068
0  xul.dll  cssparser::rules_and_declarations::impl$1::next  third_party/rust/cssparser/src/rules_and_declarations.rs:271
0  xul.dll  style::properties::declaration_block::parse_property_declaration_list  servo/components/style/properties/declaration_block.rs:1605
1  xul.dll  style::properties::declaration_block::parse_style_attribute  servo/components/style/properties/declaration_block.rs:1313
1  xul.dll  geckoservo::glue::Servo_ParseStyleAttribute  servo/ports/geckolib/glue.rs:4561
2  xul.dll  mozilla::DeclarationBlock::FromCssText  layout/style/DeclarationBlock.h:152
```