Closed Bug 1644896 Opened 4 years ago Closed 4 years ago

PermissionManager is never shut down/destroyed; leaks a thread

Categories

(Core :: Permission Manager, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: jesup, Assigned: baku)

References

(Blocks 1 open bug)

Details

Crash Data

Attachments

(3 files)

PermissionManager keeps a global StaticRefPtr<> to the PermissionManager. It nulls the RefPtr in ~PermissionManager().....

Obviously this doesn't work.

It's even more convoluted; it adds references via ::GetXPCOMSingleton(); on initial creation it calls ClearOnShutdown(); so likely one of those other refs leaked.

Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P1

Randell, if you touch this code, do you mind to introduce a async shutdown blocker? We need to be sure that the current writing/reading DB operation is completed before terminating the PermissionManager.

Flags: needinfo?(rjesup)

I do not plan to attack this bug myself.

Flags: needinfo?(rjesup)
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/73b12096811d Destroy PermissionManager on shutdown, r=timhuang

Backed out changeset 73b12096811d (bug 1644896) for mochitest crashes

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&selectedTaskRun=ULciaRSFTn66HbNkVNrtZg.0&searchStr=os%2Cx%2C10.14%2Cdebug%2Cmochitests%2Cwithout%2Ce10s%2Ctest-macosx1014-64%2Fdebug-mochitest-chrome-1proc-1%2Cm-1proc%28c1%29&fromchange=5c30a817b6187db2a5b9840ef2b1ca1d2f61ca76&tochange=9469156609ae5ccd4147308e617106c5baeaad2b

Backout link: https://hg.mozilla.org/integration/autoland/rev/9469156609ae5ccd4147308e617106c5baeaad2b

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=309560769&repo=autoland&lineNumber=1280

[task 2020-07-13T08:59:46.104Z] 08:59:46     INFO - TEST-OK | browser/components/aboutlogins/tests/chrome/test_menu_button.html | took 4768ms
[task 2020-07-13T08:59:46.128Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: Failed to retarget HTML data delivery to the parser thread.: file /builds/worker/checkouts/gecko/parser/html/nsHtml5StreamParser.cpp, line 1131
[task 2020-07-13T08:59:46.192Z] 08:59:46     INFO - TEST-START | Shutdown
[task 2020-07-13T08:59:46.192Z] 08:59:46     INFO - Passed:  394
[task 2020-07-13T08:59:46.192Z] 08:59:46     INFO - Failed:  0
[task 2020-07-13T08:59:46.192Z] 08:59:46     INFO - Todo:    0
[task 2020-07-13T08:59:46.193Z] 08:59:46     INFO - Mode:    non-e10s
[task 2020-07-13T08:59:46.193Z] 08:59:46     INFO - Slowest: 4768ms - chrome://mochitests/content/chrome/browser/components/aboutlogins/tests/chrome/test_menu_button.html
[task 2020-07-13T08:59:46.193Z] 08:59:46     INFO - SimpleTest FINISHED
[task 2020-07-13T08:59:46.193Z] 08:59:46     INFO - TEST-INFO | Ran 1 Loops
[task 2020-07-13T08:59:46.193Z] 08:59:46     INFO - SimpleTest FINISHED
[task 2020-07-13T08:59:46.653Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.654Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.654Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.654Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.670Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.670Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.697Z] 08:59:46     INFO - GECKO(1199) | JavaScript error: resource://gre/modules/AsyncShutdown.jsm, line 554: NotFoundError: No such JSWindowActor 'SpecialPowers'
[task 2020-07-13T08:59:46.751Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.751Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.767Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.768Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: '!inner', file /builds/worker/checkouts/gecko/dom/ipc/jsactor/JSWindowActorProtocol.cpp, line 172
[task 2020-07-13T08:59:46.803Z] 08:59:46     INFO - GECKO(1199) | [1199, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040111 (NS_ERROR_NOT_AVAILABLE): file /builds/worker/checkouts/gecko/netwerk/cache/nsApplicationCacheService.cpp, line 161
[task 2020-07-13T08:59:46.966Z] 08:59:46     INFO - GECKO(1199) | [2020-07-13T08:59:46Z WARN  xulstore::persist] tried to remove key that isn't in the store
[task 2020-07-13T08:59:46.966Z] 08:59:46     INFO - GECKO(1199) | [2020-07-13T08:59:46Z WARN  xulstore::persist] tried to remove key that isn't in the store
[task 2020-07-13T08:59:47.493Z] 08:59:47     INFO - GECKO(1199) | 1594630787461	Marionette	TRACE	Received observer notification xpcom-will-shutdown
[task 2020-07-13T08:59:47.494Z] 08:59:47     INFO - GECKO(1199) | 1594630787462	Marionette	INFO	Stopped listening on port 2828
[task 2020-07-13T08:59:47.494Z] 08:59:47     INFO - GECKO(1199) | 1594630787462	Marionette	DEBUG	Marionette stopped listening
[task 2020-07-13T08:59:47.498Z] 08:59:47     INFO - GECKO(1199) | [1199, Main Thread] WARNING: nsAppShell::Exit() called redundantly: file /builds/worker/checkouts/gecko/widget/cocoa/nsAppShell.mm, line 714
[task 2020-07-13T08:59:47.538Z] 08:59:47     INFO - GECKO(1199) | Storage connection not closed: permissions.sqliteHit MOZ_CRASH() at /builds/worker/checkouts/gecko/storage/mozStorageService.cpp:716
[task 2020-07-13T08:59:47.539Z] 08:59:47     INFO -  Initializing stack-fixing for the first stack frame, this may take a while...
[task 2020-07-13T09:00:02.462Z] 09:00:02     INFO - GECKO(1199) | #01: non-virtual thunk to mozilla::storage::Service::Observe(nsISupports*, char const*, char16_t const*) [storage/mozStorageService.cpp:0]
[task 2020-07-13T09:00:02.462Z] 09:00:02     INFO - GECKO(1199) | #02: nsObserverList::NotifyObservers(nsISupports*, char const*, char16_t const*) [xpcom/ds/nsObserverList.cpp:64]
[task 2020-07-13T09:00:02.462Z] 09:00:02     INFO - GECKO(1199) | #03: nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*) [xpcom/ds/nsObserverService.cpp:290]
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO - GECKO(1199) | #04: mozilla::ShutdownXPCOM(nsIServiceManager*) [xpcom/build/XPCOMInit.cpp:644]
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO - GECKO(1199) | #05: ScopedXPCOMStartup::~ScopedXPCOMStartup() [toolkit/xre/nsAppRunner.cpp:1286]
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO - GECKO(1199) | #06: XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:4885]
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO - GECKO(1199) | #07: XRE_main(int, char**, mozilla::BootstrapConfig const&) [toolkit/xre/nsAppRunner.cpp:4922]
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO -  fix-stacks error: failed to read breakpad symbols dir `/Users/cltbld/tasks/task_1594630287/build/symbols/firefox` for `/Users/cltbld/tasks/task_1594630287/build/application/Firefox NightlyDebug.app/Contents/MacOS/firefox`
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO -  fix-stacks note:  this is expected and harmless for system libraries on debug automation runs
[task 2020-07-13T09:00:02.472Z] 09:00:02     INFO - GECKO(1199) | #08: main [/Users/cltbld/tasks/task_1594630287/build/application/Firefox NightlyDebug.app/Contents/MacOS/firefox + 0x1624]
[task 2020-07-13T09:00:02.583Z] 09:00:02     INFO - TEST-INFO | Main app process: exit 1
[task 2020-07-13T09:00:02.583Z] 09:00:02     INFO - Buffered messages finished
[task 2020-07-13T09:00:02.583Z] 09:00:02    ERROR - TEST-UNEXPECTED-FAIL | Last test finished | application terminated with exit code 1
[task 2020-07-13T09:00:02.583Z] 09:00:02     INFO - runtests.py | Application ran for: 0:00:40.057780
[task 2020-07-13T09:00:02.584Z] 09:00:02     INFO - zombiecheck | Reading PID log: /var/folders/90/_p6z8y_j0yz2kjkmy_zclkw4000017/T/tmpB1cwITpidlog
[task 2020-07-13T09:00:02.584Z] 09:00:02     INFO - mozcrash Copy/paste: /Users/cltbld/tasks/task_1594630287/fetches/minidump_stackwalk/minidump_stackwalk /var/folders/90/_p6z8y_j0yz2kjkmy_zclkw4000017/T/tmp50_Sew.mozrunner/minidumps/E909904E-3184-438E-BD5F-53F4DC6A7FE9.dmp /Users/cltbld/tasks/task_1594630287/build/symbols
[task 2020-07-13T09:00:11.362Z] 09:00:11     INFO - mozcrash Saved minidump as /Users/cltbld/tasks/task_1594630287/build/blobber_upload_dir/E909904E-3184-438E-BD5F-53F4DC6A7FE9.dmp
[task 2020-07-13T09:00:11.362Z] 09:00:11     INFO - mozcrash Saved app info as /Users/cltbld/tasks/task_1594630287/build/blobber_upload_dir/E909904E-3184-438E-BD5F-53F4DC6A7FE9.extra
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - PROCESS-CRASH | Last test finished | application crashed [@ mozilla::storage::Service::Observe(nsISupports*, char const*, char16_t const*)]
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Mozilla crash reason: MOZ_CRASH()
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Crash dump filename: /var/folders/90/_p6z8y_j0yz2kjkmy_zclkw4000017/T/tmp50_Sew.mozrunner/minidumps/E909904E-3184-438E-BD5F-53F4DC6A7FE9.dmp
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Operating system: Mac OS X
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -                   10.14.5 18F132
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - CPU: amd64
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -      family 6 model 69 stepping 1
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -      4 CPUs
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - 
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - GPU: UNKNOWN
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - 
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Crash reason:  EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Crash address: 0x0
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Process uptime: 25 seconds
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - 
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO - Thread 0 (crashed)
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -  0  XUL!mozilla::storage::Service::Observe(nsISupports*, char const*, char16_t const*) [mozStorageService.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 716 + 0x0]
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     rax = 0x00000001102c615a   rdx = 0x0000000000000000
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     rcx = 0x0000000105f44480   rbx = 0x00007ffee9d64eb0
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     rsi = 0x00000000000120a8   rdi = 0x00007fffa10d8028
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     rbp = 0x00007ffee9d64f00   rsp = 0x00007ffee9d64ea0
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -      r8 = 0x00000000000130a8    r9 = 0x00007fffa10d8048
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     r10 = 0x0000000000000000   r11 = 0x00007fffa10d8040
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     r12 = 0x0000000000000006   r13 = 0x00007ffee9d64eb0
[task 2020-07-13T09:00:11.435Z] 09:00:11     INFO -     r14 = 0x00007ffee9d64ec0   r15 = 0x00007ffee9d64eb0
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x00000001075d939e
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: given as instruction pointer in context
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  1  XUL!non-virtual thunk to mozilla::storage::Service::Observe(nsISupports*, char const*, char16_t const*) [mozStorageService.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 0 + 0xd]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d64f10   rsp = 0x00007ffee9d64f10
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x00000001075d946d
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  2  XUL!nsObserverList::NotifyObservers(nsISupports*, char const*, char16_t const*) [nsObserverList.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 65 + 0xf]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d64f60   rsp = 0x00007ffee9d64f20
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x00000001066156cf
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  3  XUL!nsObserverService::NotifyObservers(nsISupports*, char const*, char16_t const*) [nsObserverService.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 287 + 0x15]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d65020   rsp = 0x00007ffee9d64f70
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x0000000106618701
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  4  XUL!mozilla::ShutdownXPCOM(nsIServiceManager*) [XPCOMInit.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 640 + 0x1d]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d65070   rsp = 0x00007ffee9d65030
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x0000000106704704
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  5  XUL!ScopedXPCOMStartup::~ScopedXPCOMStartup() [nsAppRunner.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 1285 + 0x8]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d650c0   rsp = 0x00007ffee9d65080
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x000000010c33f434
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  6  XUL!XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) [nsAppRunner.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 4885 + 0x1b]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d65160   rsp = 0x00007ffee9d650d0
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x000000010c34e05f
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  7  XUL!XRE_main(int, char**, mozilla::BootstrapConfig const&) [nsAppRunner.cpp:73b12096811dd7ab9b0e705b5d1585ab9d0dd9e7 : 4922 + 0x11]
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d652b0   rsp = 0x00007ffee9d65170
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x000000010c34e942
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  8  firefox + 0x1624
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rbp = 0x00007ffee9d65730   rsp = 0x00007ffee9d652c0
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     rip = 0x0000000105e9a624
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.436Z] 09:00:11     INFO -  9  libdyld.dylib!start + 0x1
[task 2020-07-13T09:00:11.437Z] 09:00:11     INFO -     rbp = 0x00007ffee9d65740   rsp = 0x00007ffee9d65740
[task 2020-07-13T09:00:11.437Z] 09:00:11     INFO -     rip = 0x00007fff6a7703d5
[task 2020-07-13T09:00:11.437Z] 09:00:11     INFO -     Found by: previous frame's frame pointer
[task 2020-07-13T09:00:11.437Z] 09:00:11     INFO - 
Flags: needinfo?(rjesup)
Assignee: rjesup → amarchesini
Flags: needinfo?(rjesup) → needinfo?(amarchesini)
Crash Signature: [@ mozilla::storage::Service::Observe(nsISupports*, char const*, char16_t const*)]
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d984add3abb Destroy PermissionManager on shutdown, r=timhuang https://hg.mozilla.org/integration/autoland/rev/f501e7db25a8 Add the shutdown blocker during the PermissionManager::initDB, r=asuth
Flags: needinfo?(amarchesini)
Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09f3759ac521 Destroy PermissionManager on shutdown, r=timhuang https://hg.mozilla.org/integration/autoland/rev/cc2c25d1ef62 Add the shutdown blocker during the PermissionManager::initDB, r=asuth
Attachment #9163415 - Attachment description: Bug 1644896 - Reintroduce a EnsureReadCompleted() in PermissionManager, r?timhuang → Bug 1644896 - Reintroduce an EnsureReadCompleted() in PermissionManager, r?timhuang
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0b60071ef05d Reintroduce an EnsureReadCompleted() in PermissionManager, r=timhuang
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: