Closed Bug 1509040 Opened 7 years ago Closed 6 years ago

Don't allow snapshotting in non-main processes

Categories

(Toolkit :: Telemetry, enhancement, P1)

enhancement
Points:
1

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox65 --- wontfix
firefox66 --- ?
firefox67 --- fixed

People

(Reporter: chutten, Assigned: janerik)

Details

Attachments

(2 files)

A report on Telemetry from :Bas[1] shows that we permit content processes in mochitests to try to snapshot histograms. Whoops. We should either early-return or, in the case of the JS{Keyed}Histogram objects, omit unsupported functions from their prototypes. We should also audit Scalars and Events to ensure that they do something sensible and predictable, too. [1]: https://mozilla.logbot.info/telemetry/20181121#c15640130-c15640199
Taking the bug to investigate alternatives and propose a solution.
Assignee: nobody → chutten
Status: NEW → ASSIGNED
Points: --- → 1
Priority: -- → P1
SCALARS AUDIT: On non-parent processes we return `{}` for snapshots EVENTS AUDIT: On non-parent processes we return an error for snapshots. HISTOGRAMS AUDIT: Two ways to snapshot: `getSnapshotFor{Keyed}Histograms` and `JS{Keyed}HistogramInstance.snapshot()` getSnapshotFor{Keyed}Histograms might successfully generate a snapshot with default values for all flag histograms, but it checks its return values so likely isn't an immediate problem. JS{Keyed}HistogramInstance.snapshot() doesn't check its return values, so derefs a potentially-nullptr. JS{Keyed}HistogramInstance.clear() checks its return values, so likely isn't an immediate problem. --- We need to throw some early returns in there. I vote for NS_ERROR_FAILURE to echo Events' behaviour. We can optionally also not define "snapshot" and "clear" on JS{Keyed}Histogram objects in non-parent processes. I like this approach from a "tests with bad uses can't even pass by accident" point-of-view, but I don't know how widely this behaviour might be spread (and how e10s/Fennec might interfere).
Investigation complete. Popping back out for retriage.
Assignee: chutten → nobody
Status: ASSIGNED → NEW
Priority: P1 → --
Assignee: nobody → chutten
Status: NEW → ASSIGNED
Priority: -- → P2
Assignee: chutten → nobody
Status: ASSIGNED → NEW
Assignee: nobody → jrediger
Priority: P2 → P1

Depends on D17920

Pushed by jrediger@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2ff9bc983ae7 Don't allow snapshotting/clearing in non-parent processes r=chutten https://hg.mozilla.org/integration/autoland/rev/a5d034708f99 Remove useless wrapper function r=chutten
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: