Closed Bug 1369246 Opened 8 years ago Closed 7 years ago

startPersistence crashes in GetSubdocumentWithOuterWindowId

Categories

(Core :: DOM: Core & HTML, defect)

47 Branch
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox-esr52 --- wontfix
firefox53 --- wontfix
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: Oriol, Assigned: Oriol)

References

Details

(Keywords: crash, crashreportid, regression)

Crash Data

Attachments

(1 file, 1 obsolete file)

Open the browser console, and run this code: gBrowser.selectedTab = gBrowser.addTab("about:newtab"); var aBrowser = gBrowser.selectedBrowser; window.open("about:home"); var persistable = aBrowser.QueryInterface(Ci.nsIFrameLoaderOwner) .frameLoader.QueryInterface(Ci.nsIWebBrowserPersistable); persistable.startPersistence(1234, { onDocumentReady: function(document) { console.log("startPersistence succeeded with no crash"); }, onError: function(status) { throw new Error("startPersistence failed with no crash"); } }); Firefox crashes. https://crash-stats.mozilla.com/report/index/71781656-b386-4b59-a771-387f20170601 Regression window: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=54eea211e234217c0faa8c05bf4de9fd3005f5c2&tochange=b2a3dc4b161fdfac6db78cc5bbfb1f53a383b65a I guess it's bug 1241764.
Attached patch window-fixcrash.patch (obsolete) (deleted) — Splinter Review
I don't have much idea about these window pointers but this seems to work.
Assignee: nobody → oriol-bugzilla
Status: NEW → ASSIGNED
Attachment #8873266 - Flags: review?(amarchesini)
Comment on attachment 8873266 [details] [diff] [review] window-fixcrash.patch Review of attachment 8873266 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsContentUtils.cpp @@ +4448,5 @@ > if (!aDocument || !aOuterWindowId) { > return nullptr; > } > > + nsGlobalWindow* window = nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId); RefPtr<window> nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId);
Attachment #8873266 - Flags: review?(amarchesini) → review+
(In reply to Andrea Marchesini [:baku] from comment #2) > RefPtr<window> nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId); Changing to that produces a compile error: > 'RefPtr': 'window' is not a valid template type argument for parameter 'T'
Flags: needinfo?(amarchesini)
Sorry I meant: RefPtr<nsGlobalWindow> window = nsGlobalWindow::GetOuterWindowWithId(aOuterWindowId);
Flags: needinfo?(amarchesini)
Attached patch window-fixcrash-v2.patch (deleted) — Splinter Review
Attachment #8873266 - Attachment is obsolete: true
Attachment #8873402 - Flags: review?(amarchesini)
Attachment #8873402 - Flags: review?(amarchesini) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/c52cd79ee39d Check if window pointer is null before attempting to call a method. r=baku
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: