cert storage remote settings client should be accessible somehow and not create a one-off instance without any references
Categories
(Core :: Security: PSM, defect, P1)
Tracking
()
People
(Reporter: Gijs, Assigned: keeler)
References
Details
(Whiteboard: [psm-assigned])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
static init() {
// In Bug 1543598, the OneCRL and Pinning clients will be moved in this module.
BlocklistClients.initialize();
if (AppConstants.MOZ_NEW_CERT_STORAGE) {
new RemoteSecuritySettings();
}
}
constructor() {
this.client = RemoteSettings(Services.prefs.getCharPref(INTERMEDIATES_COLLECTION_PREF), {
bucketNamePref: INTERMEDIATES_BUCKET_PREF,
lastCheckTimePref: INTERMEDIATES_CHECKED_SECONDS_PREF,
signerName: Services.prefs.getCharPref(INTERMEDIATES_SIGNER_PREF),
localFields: ["cert_import_complete"],
});
this.client.on("sync", this.onSync.bind(this));
Services.obs.addObserver(this.onObservePollEnd.bind(this),
"remote-settings:changes-poll-end");
...
}
OK, so... we never put the result of calling the RemoteSecuritySettings
constructor anywhere.
Normally, that would get it GC'd. However, in this case, we pass a reference to the client
it creates which is bound to this
via onSync
, so if the remote settings code keeps a ref to client
then that will keep it alive, and even if not, the addObserver
call is bound to this
so that will keep it alive.
But that's all pretty scary, and there's no way to call maybeSync
or anything on this instance for debug purposes and that's kind of annoying.
Can we make it a global and/or "root" the result of the new RemoteSecuritySettings
call a bit better so it staying alive isn't this kind of accident? :-)
(I should really have caught this in review...)
Comment 1•5 years ago
|
||
The priority flag is not set for this bug.
:keeler, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 2•5 years ago
|
||
The details have changed a bit, but I think the underlying issue is still present.
Assignee | ||
Comment 3•5 years ago
|
||
Comment 5•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•