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

RESOLVED FIXED in mozilla10

Status

()

Core
Layout
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: Ehsan)

Tracking

(Blocks: 1 bug)

Trunk
mozilla10
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

/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
Created attachment 564853 [details] [diff] [review]
Patch (v1)
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.