Open Bug 1621726 Opened 5 months ago Updated 5 days ago

JSWindowActorParent::willDestroy is not called if actor destruction is due to a tab being closed

Categories

(Core :: DOM: Content Processes, defect, P2)

defect

Tracking

()

Fission Milestone M6c

People

(Reporter: pbz, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(2 obsolete files)

willDestroy does not seem to be called for JSWindowActorParent when I close a tab.

It seems that Bug 1596187 fixed this for child actors.

Yoric, this bug is related to your JSContentActor work.

Nika is considering changing the JSWindowActorParent manager from PBrowser to PContent to avoid these shutdown issues.

kmag is concerned that people will be using broken willDestroy. Nika says this would be a quick fix.

Fission Milestone: --- → M6
Flags: needinfo?(dteller)
Priority: -- → P2

Is there any action needed on my part?

Flags: needinfo?(dteller) → needinfo?(nika)

(In reply to Chris Peterson [:cpeterson] from comment #1)

Yoric, this bug is related to your JSContentActor work.

Nika is considering changing the JSWindowActorParent manager from PBrowser to PContent to avoid these shutdown issues.

(In reply to David Teller [:Yoric] (please use "needinfo") from comment #2)

Is there any action needed on my part?

Nika, IIRC, you suggested Yoric would be a good person to fix this bug after his JSContentActor work. But I do not recall whether your comment that you are "considering changing the JSWindowActorParent" meant that you were going to make that change or that whoever fixes this bug should make those change..?

Previously, the PWindowGlobal actor was managed by the PBrowser which hosted it,
however this could cause issues when the tab containing the PWindowGlobal was
being destroyed. Due to the slightly different lifecycles of the PBrowser actor
and the nsGlobalWindowInner which the PWindowGlobal was trying to match the
lifetime of, the actor would sometimes not fire 'willDestroy' events correctly.

This patch moves PWindowGlobal to be directly managed by PContent, and changes
logic which previously used Manager() to get Browser{Parent,Child} to
instead use a pointer member.

Assignee: nobody → nika
Status: NEW → ASSIGNED
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9e1fba94da3a
Manage PWindowGlobal with PContent instead of PBrowser, r=farre

Backed out for bustages on WinHeaderOnlyUtils.h

backout: https://hg.mozilla.org/integration/autoland/rev/3698608244f3caa38ead55ddf6bb8e0b712e2b23

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=9e1fba94da3a73b543bfdd1cf101d1451bbbde14&selectedJob=295647048

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=295647030&repo=autoland&lineNumber=66319

[task 2020-03-31T20:50:00.783Z] 20:50:00 INFO - In file included from /builds/worker/workspace/obj-build/dist/include/mozilla/UntrustedModulesData.h:21:
[task 2020-03-31T20:50:00.783Z] 20:50:00 ERROR - /builds/worker/workspace/obj-build/dist/include/mozilla/WinHeaderOnlyUtils.h:329:23: error: use of undeclared identifier 'WAIT_FAILED'; did you mean 'dom::WebGL2RenderingContext_Binding::WAIT_FAILED'?
[task 2020-03-31T20:50:00.783Z] 20:50:00 INFO - if (waitResult == WAIT_FAILED &&
[task 2020-03-31T20:50:00.783Z] 20:50:00 INFO - ^~~~~~~~~~~
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - dom::WebGL2RenderingContext_Binding::WAIT_FAILED
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - /builds/worker/workspace/obj-build/dist/include/mozilla/dom/WebGL2RenderingContextBinding.h:660:25: note: 'dom::WebGL2RenderingContext_Binding::WAIT_FAILED' declared here
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - static const uint32_t WAIT_FAILED = 37149;
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - ^
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - 1 error generated.
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - /builds/worker/checkouts/gecko/config/rules.mk:750: recipe for target 'UnifiedBindings1.o' failed
[task 2020-03-31T20:50:00.784Z] 20:50:00 ERROR - make[4]: *** [UnifiedBindings1.o] Error 1
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - make[4]: Leaving directory '/builds/worker/workspace/obj-build/dom/bindings'
[task 2020-03-31T20:50:00.784Z] 20:50:00 INFO - make[4]: *** Waiting for unfinished jobs....

Flags: needinfo?(nika)
Flags: needinfo?(nika)

It appears this is caused by the #undef WAIT_FAILED which is generated by webidl in WebGL2RenderingContext_Binding.h (https://searchfox.org/mozilla-central/rev/7fba7adfcd695343236de0c12e8d384c9b7cd237/dom/webidl/WebGL2RenderingContext.webidl#286). Previously, WinHeaderOnlyUtils.h and WebGLRenderingContext_Binding.h presumably didn't participate in the same compilation unit.

A quick scan suggests that there are only 2 users of [NeedsWindowsUndef], for NO_ERROR and WAIT_FAILED, which were added in bug 792059.
Nowadays we have the windows.h wrapper from bug 1448426, so it should be possible to add NO_ERROR and WAIT_FAILED to windows-h-constant.decls.h, and remove that attribute entirely.

Attachment #9136388 - Attachment description: Bug 1621726 - Manage PWindowGlobal with PContent instead of PBrowser, → Bug 1621726 - Part 1: Manage PWindowGlobal with PContent instead of PBrowser,
Flags: needinfo?(nika)
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c43c38de33b2
Part 1: Manage PWindowGlobal with PContent instead of PBrowser, r=farre
https://hg.mozilla.org/integration/autoland/rev/ebe18133a194
Part 2: Remove [NeedsWindowsUndef] attribute from webidl, r=peterv
Backout by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/33f5a8585f57
Backed out 2 changesets for web platform test failures CLOSED TREE

Backed out 2 changesets (bug 1621726) for web platform test failures

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=web%2Cplatform%2Ctests&fromchange=3a43210e49005094bab673e7f963e19901c39fe2&tochange=33f5a8585f5733b8ab9dad23972b9f587d2d1969&selectedJob=296459066

Backout link: https://hg.mozilla.org/integration/autoland/rev/33f5a8585f5733b8ab9dad23972b9f587d2d1969

Failures logs: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=296459066&repo=autoland&lineNumber=10725

[task 2020-04-06T18:38:39.656Z] 18:38:39     INFO - TEST-START | /xhr/send-data-arraybufferview.any.html
[task 2020-04-06T18:38:39.663Z] 18:38:39     INFO - Closing window 522
[task 2020-04-06T18:38:39.796Z] 18:38:39     INFO - PID 17724 | ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[task 2020-04-06T18:38:40.182Z] 18:38:40     INFO - PID 17724 | Maximum number of clients reachedUnable to init server: Could not connect: Connection refused
[task 2020-04-06T18:38:40.182Z] 18:38:40     INFO - PID 17724 | (/builds/worker/workspace/build/application/firefox/firefox:25422): Gtk-WARNING **: 18:38:40.170: cannot open display: :0
[task 2020-04-06T18:38:40.244Z] 18:38:40     INFO - PID 17724 | [Parent 17724, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:38:40.246Z] 18:38:40     INFO - PID 17724 | [Parent 17724, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:38:40.246Z] 18:38:40     INFO - PID 17724 | [Parent 17724, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:38:40.246Z] 18:38:40     INFO - PID 17724 | [Parent 17724, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:38:40.248Z] 18:38:40     INFO - PID 17724 | [Parent 17724, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:38:40.249Z] 18:38:40     INFO - PID 17724 | A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
[task 2020-04-06T18:38:40.845Z] 18:38:40     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:40.845Z] 18:38:40     INFO - PID 17724 | Suppressions used:
[task 2020-04-06T18:38:40.845Z] 18:38:40     INFO - PID 17724 |   count      bytes template
[task 2020-04-06T18:38:40.845Z] 18:38:40     INFO - PID 17724 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:38:40.846Z] 18:38:40     INFO - PID 17724 |     633      18287 libfontconfig.so
[task 2020-04-06T18:38:40.846Z] 18:38:40     INFO - PID 17724 |       1         11 libglib-2.0.so
[task 2020-04-06T18:38:40.846Z] 18:38:40     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:40.865Z] 18:38:40     INFO - IOError on command, setting status to CRASH
[task 2020-04-06T18:38:40.882Z] 18:38:40     INFO - TEST-UNEXPECTED-CRASH | /xhr/send-data-arraybufferview.any.html | expected OK
[task 2020-04-06T18:38:40.884Z] 18:38:40     INFO - TEST-INFO took 1220ms
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 | Suppressions used:
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 |   count      bytes template
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 |     633      18287 libfontconfig.so
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 |       1         11 libglib-2.0.so
[task 2020-04-06T18:38:41.610Z] 18:38:41     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 | Suppressions used:
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 |   count      bytes template
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 |     633      18287 libfontconfig.so
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 |       1         11 libglib-2.0.so
[task 2020-04-06T18:38:41.854Z] 18:38:41     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:41.975Z] 18:38:41     INFO - PID 17724 | 1586198321970	Marionette	INFO	Stopped listening on port 51314
[task 2020-04-06T18:38:42.078Z] 18:38:42     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:42.078Z] 18:38:42     INFO - PID 17724 | Suppressions used:
[task 2020-04-06T18:38:42.078Z] 18:38:42     INFO - PID 17724 |   count      bytes template
[task 2020-04-06T18:38:42.078Z] 18:38:42     INFO - PID 17724 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:38:42.080Z] 18:38:42     INFO - PID 17724 |     633      18287 libfontconfig.so
[task 2020-04-06T18:38:42.080Z] 18:38:42     INFO - PID 17724 |       1         11 libglib-2.0.so
[task 2020-04-06T18:38:42.081Z] 18:38:42     INFO - PID 17724 | -----------------------------------------------------
[task 2020-04-06T18:38:44.317Z] 18:38:44     INFO - PID 17724 | =================================================================
[task 2020-04-06T18:38:44.318Z] 18:38:44     INFO - PID 17724 | LeakSanitizer: detected memory leaks
...
...

https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=296456515&repo=autoland&lineNumber=12803

[task 2020-04-06T18:35:31.298Z] 18:35:31     INFO - TEST-START | /offscreen-canvas/path-objects/2d.path.rect.zero.2.html
[task 2020-04-06T18:35:31.300Z] 18:35:31     INFO - Closing window 470
[task 2020-04-06T18:35:31.781Z] 18:35:31     INFO - PID 28426 | Maximum number of clients reachedMaximum number of clients reachedUnable to init server: Could not connect: Connection refused
[task 2020-04-06T18:35:31.782Z] 18:35:31     INFO - PID 28426 | (/builds/worker/workspace/build/application/firefox/firefox:5224): Gtk-WARNING **: 18:35:31.773: cannot open display: :0
[task 2020-04-06T18:35:31.861Z] 18:35:31     INFO - PID 28426 | [Parent 28426, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:35:31.861Z] 18:35:31     INFO - PID 28426 | [Parent 28426, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:35:31.862Z] 18:35:31     INFO - PID 28426 | [Parent 28426, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:35:31.862Z] 18:35:31     INFO - PID 28426 | [Parent 28426, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:35:31.862Z] 18:35:31     INFO - PID 28426 | [Parent 28426, Gecko_IOThread] WARNING: FileDescriptorSet destroyed with unconsumed descriptors: file /builds/worker/checkouts/gecko/ipc/chromium/src/chrome/common/file_descriptor_set_posix.cc, line 19
[task 2020-04-06T18:35:31.862Z] 18:35:31     INFO - PID 28426 | A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
[task 2020-04-06T18:35:32.145Z] 18:35:32     INFO - PID 28426 | ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[task 2020-04-06T18:35:32.285Z] 18:35:32     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:32.287Z] 18:35:32     INFO - PID 28426 | Suppressions used:
[task 2020-04-06T18:35:32.288Z] 18:35:32     INFO - PID 28426 |   count      bytes template
[task 2020-04-06T18:35:32.289Z] 18:35:32     INFO - PID 28426 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:35:32.290Z] 18:35:32     INFO - PID 28426 |     633      18287 libfontconfig.so
[task 2020-04-06T18:35:32.291Z] 18:35:32     INFO - PID 28426 |       1         11 libglib-2.0.so
[task 2020-04-06T18:35:32.292Z] 18:35:32     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:32.464Z] 18:35:32     INFO - IOError on command, setting status to CRASH
[task 2020-04-06T18:35:32.471Z] 18:35:32     INFO - TEST-UNEXPECTED-CRASH | /offscreen-canvas/path-objects/2d.path.rect.zero.2.html | expected OK
[task 2020-04-06T18:35:32.473Z] 18:35:32     INFO - TEST-INFO took 1177ms
[task 2020-04-06T18:35:32.510Z] 18:35:32     INFO - PID 28426 | ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[task 2020-04-06T18:35:33.043Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:33.043Z] 18:35:33     INFO - PID 28426 | Suppressions used:
[task 2020-04-06T18:35:33.045Z] 18:35:33     INFO - PID 28426 |   count      bytes template
[task 2020-04-06T18:35:33.045Z] 18:35:33     INFO - PID 28426 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:35:33.045Z] 18:35:33     INFO - PID 28426 |     633      18287 libfontconfig.so
[task 2020-04-06T18:35:33.045Z] 18:35:33     INFO - PID 28426 |       1         11 libglib-2.0.so
[task 2020-04-06T18:35:33.045Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 | Suppressions used:
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 |   count      bytes template
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 |     633      18287 libfontconfig.so
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 |       1         11 libglib-2.0.so
[task 2020-04-06T18:35:33.311Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:33.399Z] 18:35:33     INFO - PID 28426 | 1586198133394	Marionette	INFO	Stopped listening on port 60778
[task 2020-04-06T18:35:33.476Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:33.477Z] 18:35:33     INFO - PID 28426 | Suppressions used:
[task 2020-04-06T18:35:33.478Z] 18:35:33     INFO - PID 28426 |   count      bytes template
[task 2020-04-06T18:35:33.479Z] 18:35:33     INFO - PID 28426 |      27        832 nsComponentManagerImpl
[task 2020-04-06T18:35:33.480Z] 18:35:33     INFO - PID 28426 |     633      18287 libfontconfig.so
[task 2020-04-06T18:35:33.480Z] 18:35:33     INFO - PID 28426 |       1         11 libglib-2.0.so
[task 2020-04-06T18:35:33.482Z] 18:35:33     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:35.419Z] 18:35:35     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:35.419Z] 18:35:35     INFO - PID 28426 | Suppressions used:
[task 2020-04-06T18:35:35.419Z] 18:35:35     INFO - PID 28426 |   count      bytes template
[task 2020-04-06T18:35:35.420Z] 18:35:35     INFO - PID 28426 |      24        728 nsComponentManagerImpl
[task 2020-04-06T18:35:35.420Z] 18:35:35     INFO - PID 28426 |     266       9804 libfontconfig.so
[task 2020-04-06T18:35:35.421Z] 18:35:35     INFO - PID 28426 |       1         11 libglib-2.0.so
[task 2020-04-06T18:35:35.422Z] 18:35:35     INFO - PID 28426 |       4        832 mozJSComponentLoader
[task 2020-04-06T18:35:35.422Z] 18:35:35     INFO - PID 28426 | -----------------------------------------------------
[task 2020-04-06T18:35:35.504Z] 18:35:35     INFO - Browser exited with return code 0
[task 2020-04-06T18:35:35.504Z] 18:35:35     INFO - PROCESS LEAKS None
[task 2020-04-06T18:35:35.507Z] 18:35:35     INFO - Closing logging queue
Flags: needinfo?(nika)

Comment on attachment 9137867 [details]
Bug 1621726 - Part 2: Remove [NeedsWindowsUndef] attribute from webidl,

Revision D69450 was moved to bug 1630361. Setting attachment 9137867 [details] to obsolete.

Attachment #9137867 - Attachment is obsolete: true
Attachment #9136388 - Attachment is obsolete: true
Blocks: 1649317
Blocks: 1649318

M6b or M6c?

We should make this change soon because kmag is worried this fix might cause other problems.

Fission Milestone: M6 → M6b
See Also: → 1651802
Depends on: 1651802
See Also: 1651802
Fission Milestone: M6b → M6c
See Also: → 1649317
See Also: → 1651802

The previous approach I took here was flawed for various reasons, and it seems from bug 1651802 and other related bugs like we may be able to fix the issues causing frontend code to use willDestroy, and remove the callback entirely.

Unassigning myself from this bug while we work out what to do there.

Assignee: nika → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(nika)
You need to log in before you can comment on or make changes to this bug.