Closed Bug 692109 Opened 8 years ago Closed 8 years ago

The intended crash in nsIFrame::GetOffsetToCrossDoc won't actually crash with some compilers

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file)

/Users/ehsanakhgari/moz/mozilla-central/layout/generic/nsFrame.cpp:4077:5: warning: indirection of non-volatile null pointer will be deleted, not trap
      [-Wnull-dereference]
    *(static_cast<PRInt32*>(nsnull)) = 3;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/ehsanakhgari/moz/mozilla-central/layout/generic/nsFrame.cpp:4077:5: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
1 warning generated.

While this could be fixed by making the pointer volatile, we should really use NS_RUNTIMEABORT, which gives us nice crash signatures like this: https://crash-stats.mozilla.com/report/index/0f429455-ba92-4789-aa05-7984c2111005
Summary: The intended crash in nsIFrame::GetOffsetToCrossDoc won't actually crash → The intended crash in nsIFrame::GetOffsetToCrossDoc won't actually crash with some compilers
Attached patch Patch (v1)Splinter Review
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attachment #564853 - Flags: review?(tnikkel)
Comment on attachment 564853 [details] [diff] [review]
Patch (v1)

I've pretty much got all the information I can from crashstats with this intended crash there and I still don't know how to fix the bug. I'm not sure how to proceed in fixing the main bug, whether it is better to leave the crash in or take it out.

Either way this is good.
Attachment #564853 - Flags: review?(tnikkel) → review+
(And I haven't seen any more infinite recursion crash stacks, so we aren't missing any information that we could be getting if this was causing a problem.)
https://hg.mozilla.org/mozilla-central/rev/a16971b9a582
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.