Closed Bug 1563163 Opened 5 months ago Closed 3 months ago

Tab crashes when inspecting page in Print Preview mode

Categories

(DevTools :: Inspector, defect)

67 Branch
defect
Not set

Tracking

(firefox70 verified)

VERIFIED FIXED
Firefox 70
Tracking Status
firefox70 --- verified

People

(Reporter: dale, Assigned: bradwerth, NeedInfo)

References

Details

Crash Data

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0

Steps to reproduce:

  1. Open any page;
  2. Go into print preview;
  3. Right Click - Inspect Element;

Actual results:

Tab crash

Expected results:

Inspector opened with css styles for @print media

Please follow the steps on http://support.mozilla.com/kb/Firefox%20crashes and report back here. Thanks!

Flags: needinfo?(dale)
Component: Untriaged → Print Preview
Product: Firefox → Core

Hello Andre!

Just reproduced the bug in safe mode.

Firefox is clean and up to date (latest from the repos).

Flags: needinfo?(dale)

Hello Dale - Do you have a crash report in about:crashes? If so, please paste it here. Thanks.

Flags: needinfo?(dale)

I can reproduce this trivially: https://crash-stats.mozilla.org/report/index/1e57a5c2-458a-4a1a-ac93-4d11f0190822

It's crasing with a null dereference here on the flexbox lenght code: https://crash-stats.mozilla.org/report/index/63d85631-d0b7-481b-92eb-3bce60190822

Brad, seems you are familiar with that code? We could at least mitigate the crash I'm sure.

Status: UNCONFIRMED → NEW
Component: Print Preview → Inspector
Ever confirmed: true
Flags: needinfo?(bwerth)
Product: Core → DevTools

Okay, the core issue is that nsPageSequenceFrame::Reflow early exits during incremental reflow at https://searchfox.org/mozilla-central/source/layout/generic/nsPageSequenceFrame.cpp#152. So the flex container is supposed to reflow and generate the FlexContainerInfo structure, but never gets the chance. The Flex::Flex constructor assumes that the structure exists, and dereferences the NULL pointer.

I don't know how to fix the nsPageSequenceFrame::Reflow issue, so I'll needinfo Mats on that -- is there an existing bug? I'll fix the Flex::Flex code to gracefully handle the case of the missing FlexContainerInfo structure. That will fix the crash, but we'll also have an empty Flex Layout panel when inspecting flex containers under these conditions.

Flags: needinfo?(bwerth) → needinfo?(mats)

That's a can of worms, see bug 1157012 and the bugs linked from there.

Flags: needinfo?(mats)
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5119f09d6b99
Part 1: Make Flex::Flex gracefully handle frames without FlexContainerInfo structures. r=mats
https://hg.mozilla.org/integration/autoland/rev/776f100fead6
Part 2: Downgrade an assert to a warning in nsFlexContainerFrame::GetFlexFrameWithComputedInfo. r=mats
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Assignee: nobody → bwerth
Duplicate of this bug: 1551114
Duplicate of this bug: 1535990
Crash Signature: [@ mozilla::dom::Flex::Flex]
Flags: qe-verify+

Following the STR from the first comment, I managed to reproduce the issue on nightly 69.0a1 (2019-07-02) but only for the Twitter, YouTube and Reddit websites .
I can confirm that the issue is fixed in 70.0b6.

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