Closed
Bug 1371708
Opened 8 years ago
Closed 8 years ago
Stylo: panic loading rules for a <link> element
Categories
(Core :: CSS Parsing and Computation, defect, P1)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox54 | --- | unaffected |
firefox55 | --- | disabled |
firefox56 | --- | fixed |
People
(Reporter: jryans, Assigned: heycam)
References
Details
(Keywords: crash)
Attachments
(1 file)
DevTools tries to pull rules using inDOMUtils::GetCSSStyleRules when a node is selected in the inspector. When you select a <link> element that references a stylesheet, such as:
<link rel="stylesheet" type="text/css" href="style.css">
this appears to lead to a panic in tests like:
* devtools/client/inspector/markup/test/browser_markup_links_01.js[1]
17 INFO Testing attributes on node link
18 INFO Selecting the node for 'link'
GECKO(54309) | thread '<unnamed>' panicked at 'already immutably borrowed', /Users/jryans/projects/mozilla/gecko-dev-stylo-2/third_party/rust/atomic_refcell/src/lib.rs:198
GECKO(54309) | stack backtrace:
GECKO(54309) | 0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
GECKO(54309) | 1: std::panicking::default_hook::{{closure}}
GECKO(54309) | 2: std::panicking::default_hook
GECKO(54309) | 3: std::panicking::rust_panic_with_hook
GECKO(54309) | 4: std::panicking::begin_panic
GECKO(54309) | 5: std::panicking::begin_panic_fmt
GECKO(54309) | 6: atomic_refcell::AtomicBorrowRefMut::new
GECKO(54309) | 7: <atomic_refcell::AtomicRefCell<T>>::borrow_mut
GECKO(54309) | 8: style::gecko::data::PerDocumentStyleData::borrow_mut
GECKO(54309) | 9: geckoservo::glue::get_pseudo_style
GECKO(54309) | 10: geckoservo::glue::Servo_ResolveStyleLazily::{{closure}}::{{closure}}
GECKO(54309) | 11: <core::option::Option<T>>::and_then
GECKO(54309) | 12: geckoservo::glue::Servo_ResolveStyleLazily::{{closure}}
GECKO(54309) | 13: geckoservo::glue::Servo_ResolveStyleLazily::{{closure}}
GECKO(54309) | 14: style::traversal::resolve_style
GECKO(54309) | 15: Servo_ResolveStyleLazily
GECKO(54309) | 16: _ZN7mozilla13ServoStyleSet18ResolveStyleLazilyEPNS_3dom7ElementENS_20CSSPseudoElementTypeENS_18StyleRuleInclusionE
GECKO(54309) | 17: _ZN7mozilla13ServoStyleSet21ResolveTransientStyleEPNS_3dom7ElementEP7nsIAtomNS_20CSSPseudoElementTypeENS_18StyleRuleInclusionE
GECKO(54309) | 18: _ZN18nsComputedDOMStyle24DoGetStyleContextNoFlushEPN7mozilla3dom7ElementEP7nsIAtomP12nsIPresShellNS_9StyleTypeENS_13AnimationFlagE
GECKO(54309) | 19: _ZN18nsComputedDOMStyle15GetStyleContextEPN7mozilla3dom7ElementEP7nsIAtomP12nsIPresShellNS_9StyleTypeE
GECKO(54309) | 20: _ZN10inDOMUtils16GetCSSStyleRulesEP13nsIDOMElementRK9nsAStringPP18nsIArrayExtensions
[1]: https://treeherder.mozilla.org/logviewer.html#?job_id=105301367&repo=try&lineNumber=12449
Updated•8 years ago
|
Priority: -- → P1
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8877480 [details]
Bug 1371708 - Stop borrowing PerDocumentStyleData twice when resolving lazy pseudo styles.
https://reviewboard.mozilla.org/r/148926/#review153382
I'd swear I had written a very similar patch to this one and sent it for review, but apparently I forgot about the second part... Shrug. r=me
::: servo/ports/geckolib/glue.rs:2569
(Diff revision 1)
> debug_assert!(!snapshots.is_null());
> let global_style_data = &*GLOBAL_STYLE_DATA;
> let guard = global_style_data.shared_lock.read();
> let element = GeckoElement(element);
> let doc_data = PerDocumentStyleData::from_ffi(raw_data);
> + let data = doc_data.borrow();
Well, this adds a borrow in the common case, but I guess that's fine.
Attachment #8877480 -
Flags: review?(emilio+bugs) → review+
Assignee | ||
Comment 4•8 years ago
|
||
Assignee | ||
Comment 7•8 years ago
|
||
merged.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
status-firefox54:
--- → unaffected
status-firefox55:
--- → disabled
status-firefox56:
--- → fixed
status-firefox-esr52:
--- → unaffected
Reporter | ||
Updated•8 years ago
|
Target Milestone: --- → mozilla56
You need to log in
before you can comment on or make changes to this bug.
Description
•