Closed Bug 1122322 Opened 9 years ago Closed 9 years ago

Fix worker memory reporter

Categories

(Core :: DOM: Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox35 --- wontfix
firefox36 --- fixed
firefox37 --- fixed
firefox38 --- fixed
firefox-esr31 --- unaffected

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(2 files, 1 obsolete file)

Bug 1103958 comment 42 has the explanation.
Blocks: 1103958
Assignee: nobody → n.nethercote
Blocks: 1010064
Attachment #8550065 - Flags: review?(bent.mozilla)
Comment on attachment 8550065 [details] [diff] [review]
Fix crash in worker memory reporter

Review of attachment 8550065 [details] [diff] [review]:
-----------------------------------------------------------------

As long as this still maintains the anonymity of the reports that you're aiming for this seems fine to me.
Attachment #8550065 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/c7ff0dd7ad8a
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Let's please get this backported as far as possible.
Comment on attachment 8550065 [details] [diff] [review]
Fix crash in worker memory reporter

Approval Request Comment
[Feature/regressing bug #]: Bug 1010064 (shipped in FF33)

[User impact if declined]: Possible crashes when getting memory reports (e.g. viewing about:memory)

[Describe test coverage new/current, TBPL]: No automated tests, alas.

[Risks and why]: Very low. The patch just moves a null-check (and a small amount of associated code) earlier in order to avoid a null dereference.

[String/UUID change made/needed]: None.
Attachment #8550065 - Flags: approval-mozilla-beta?
Attachment #8550065 - Flags: approval-mozilla-aurora?
Attachment #8550065 - Flags: approval-mozilla-beta?
Attachment #8550065 - Flags: approval-mozilla-beta+
Attachment #8550065 - Flags: approval-mozilla-aurora?
Attachment #8550065 - Flags: approval-mozilla-aurora+
Wonfix for 35, since we have this bug since 33, we can wait one more cycle.
Thank you for the landings, RyanVM.
Many apologies -- I botched the previous patch. Moving the null check earlier
was good, but moving the BlockAndCollectRuntimeStats() call earlier was bad,
because it depends on the |path| assignment. This was causing worker
measurements to not show up under "Explicit Allocations" as they should have.

I've added some assertions that would have caught this in debug builds, and I
filed bug 1124469 to improve the testing of worker memory reporters.

This will need backporting to Aurora and Beta.
Attachment #8552748 - Flags: review?(bent.mozilla)
Comment on attachment 8552748 [details] [diff] [review]
(follow-up) - Fix busted paths in worker memory reporter

Review of attachment 8552748 [details] [diff] [review]:
-----------------------------------------------------------------

This looks fine, one suggestion:

::: dom/workers/WorkerPrivate.cpp
@@ +1733,5 @@
> +static bool
> +StartsWithExplicit(nsACString& s)
> +{
> +    const char* e = "explicit/";
> +    return Substring(s, 0, strlen(e)).Equals(e);

How about just:

  return StringBeginsWith(s, NS_LITERAL_CSTRING("explicit/"));

Then you don't need |e|
Attachment #8552748 - Flags: review?(bent.mozilla) → review+
This is the version that landed. It'll need uplifting.
Attachment #8552748 - Attachment is obsolete: true
Comment on attachment 8553557 [details] [diff] [review]
(follow-up) - Fix busted paths in worker memory reporter

Review of attachment 8553557 [details] [diff] [review]:
-----------------------------------------------------------------

Carrying over the r+.
Attachment #8553557 - Flags: review+
Comment on attachment 8553557 [details] [diff] [review]
(follow-up) - Fix busted paths in worker memory reporter

Approval Request Comment

[Feature/regressing bug #]: The previous patch in this bug had a defect. Sorry!

[User impact if declined]: Incorrect measurements of workers in about:memory.

[Describe test coverage new/current, TreeHerder]: I did a better job of testing locally this time, plus I added assertions that would have caught the original problem immediately. Bug 1124469 is open for improving test coverage.

[Risks and why]: Very low. 

[String/UUID change made/needed]: None.
Attachment #8553557 - Flags: approval-mozilla-beta?
Attachment #8553557 - Flags: approval-mozilla-aurora?
Reset of the flags to make sure Ryan sees it
Attachment #8553557 - Flags: approval-mozilla-beta?
Attachment #8553557 - Flags: approval-mozilla-beta+
Attachment #8553557 - Flags: approval-mozilla-aurora?
Attachment #8553557 - Flags: approval-mozilla-aurora+
Blocks: 1125989
No longer blocks: 1125989
Blocks: 1113594
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: