Closed Bug 1598529 Opened 6 years ago Closed 6 years ago

Empty Base Profiler profile makes Gecko Profiler profile JSON ill-formed

Categories

(Core :: Gecko Profiler, defect, P2)

72 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- wontfix
firefox72 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

When Gecko Profiler grabs a Base Profiler profile, it assumes that it is empty if the string is totally empty:
https://searchfox.org/mozilla-central/rev/581466eef9269afb03d8a0dba2f50215f3a9026c/tools/profiler/core/platform.cpp#3985
However an empty profile results in a JSON with 1 character -- a newline.

... And that caused Gecko Profiler to just blindly "splice" this non-empty looking string into its profile, so the JSON looked like: [ <valid JSON here>, ] -- Notice the missing object after the comma.

JSON profiles from the Base Profiler were assumed to be empty if they contained
zero characters, but in fact they contain one character (a single newline).

Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1e969b7c2352 Empty JSON profiles may in fact contain 1 character - r=gregtatum
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6aa8b2b48eb4 Empty JSON profiles may in fact contain 1 character - r=gregtatum
Flags: needinfo?(gsquelart)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72

Hi Gerald, is qa needed here? If so, could you provide us with some steps? Thanks!

Flags: needinfo?(gsquelart)

No qa needed, thank you.

Flags: needinfo?(gsquelart)
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: