Closed Bug 1571171 Opened 5 years ago Closed 4 years ago

Perma [tier 2] tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true

Categories

(Core :: Gecko Profiler, defect, P2)

70 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox75 --- unaffected
firefox76 --- unaffected
firefox77 --- disabled
firefox78 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: mozbugz)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: intermittent-failure, regression)

Attachments

(2 files)

Filed by: opoprus [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=259720261&repo=mozilla-inbound
Full log: https://queue.taskcluster.net/v1/task/auH17HpTR_KNDaFaSRP5vQ/runs/0/artifacts/public/logs/live_backing.log
Reftest URL: https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://queue.taskcluster.net/v1/task/auH17HpTR_KNDaFaSRP5vQ/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1


[task 2019-08-03T00:10:03.042Z] 00:10:03 INFO - TEST-START | tools/profiler/tests/xpcshell/test_merged_stacks.js
[task 2019-08-03T00:10:04.168Z] 00:10:04 WARNING - TEST-UNEXPECTED-FAIL | tools/profiler/tests/xpcshell/test_merged_stacks.js | xpcshell return code: 0
[task 2019-08-03T00:10:04.169Z] 00:10:04 INFO - TEST-INFO took 1127ms
[task 2019-08-03T00:10:04.169Z] 00:10:04 INFO - >>>>>>>
[task 2019-08-03T00:10:04.170Z] 00:10:04 INFO - PID 10429 | *** You are running in chaos test mode. See ChaosMode.h. ***
[task 2019-08-03T00:10:04.170Z] 00:10:04 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2019-08-03T00:10:04.171Z] 00:10:04 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2019-08-03T00:10:04.171Z] 00:10:04 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2019-08-03T00:10:04.171Z] 00:10:04 INFO - running event loop
[task 2019-08-03T00:10:04.172Z] 00:10:04 INFO - "CONSOLE_MESSAGE: (info) No chrome package registered for chrome://branding/locale/brand.properties"
[task 2019-08-03T00:10:04.172Z] 00:10:04 INFO - tools/profiler/tests/xpcshell/test_merged_stacks.js | Starting
[task 2019-08-03T00:10:04.173Z] 00:10:04 INFO - (xpcshell/head.js) | test pending (2)
[task 2019-08-03T00:10:04.173Z] 00:10:04 INFO - (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2019-08-03T00:10:04.174Z] 00:10:04 INFO - PID 10429 | console.log: "Actual stack: " ["(root)", "xpcshell argument processing", "0x7f6b91df2e74", "0x7f6b9641a0b9", "0x7f6b963d2b7c", "0x7f6b963d2a0a", "js::RunScript", "0x7f6b94e64d0e", "0x7f6b94e660c2", "0x7f6b966261a6", "0x31aac439548e", "0x7f6b82a4fe8f", "0x31aac4397797", "0x7f6b9504e739", "0x7f6b94e78f68", "js::RunScript", "0x7f6b94e64d0e", "0x7f6b94e6eb15", "0x7f6b94e78fef", "0x7f6b94bab02e", "0x7f6b94ba9d58", "0x7f6b970afb85", "0x7f6b951cdf83", "0x7f6b94b360e5", "0x7f6b94b3577d", "0x7f6b962e3054", "0x563094fbd028", "0x7f6b9929fb1e"]
[task 2019-08-03T00:10:04.174Z] 00:10:04 INFO - PID 10429 | console.log: "Expected to contain: " ["(root)", "/^0x[0-9a-f]+$/", "/^0x[0-9a-f]+$/", "js::RunScript", "/^0x[0-9a-f]+$/", "/^0x[0-9a-f]+$/", "/^functionA \\(.+test_merged_stacks\\.js:\\d+:\\d+\\)$/", "/^functionB \\(.+test_merged_stacks\\.js:\\d+:\\d+\\)$/", "/^functionC \\(.+test_merged_stacks\\.js:\\d+:\\d+\\)$/", "/^0x[0-9a-f]+$/", "/^0x[0-9a-f]+$/"]
[task 2019-08-03T00:10:04.175Z] 00:10:04 INFO - "Could not find a match for: "/^functionA \(.+test_merged_stacks\.js:\d+:\d+\)$/""
[task 2019-08-03T00:10:04.175Z] 00:10:04 WARNING - TEST-UNEXPECTED-FAIL | tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true
[task 2019-08-03T00:10:04.176Z] 00:10:04 INFO - /builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/test_merged_stacks.js:null:34
[task 2019-08-03T00:10:04.176Z] 00:10:04 INFO - exiting test
[task 2019-08-03T00:10:04.177Z] 00:10:04 INFO - Unexpected exception NS_ERROR_ABORT:
[task 2019-08-03T00:10:04.177Z] 00:10:04 INFO - _abort_failed_test@/builds/worker/workspace/build/tests/xpcshell/head.js:788:20
[task 2019-08-03T00:10:04.178Z] 00:10:04 INFO - do_report_result@/builds/worker/workspace/build/tests/xpcshell/head.js:889:23
[task 2019-08-03T00:10:04.178Z] 00:10:04 INFO - Assert<@/builds/worker/workspace/build/tests/xpcshell/head.js:66:21
[task 2019-08-03T00:10:04.178Z] 00:10:04 INFO - proto.report@resource://testing-common/Assert.jsm:233:10
[task 2019-08-03T00:10:04.179Z] 00:10:04 INFO - proto.ok@resource://testing-common/Assert.jsm:259:10
[task 2019-08-03T00:10:04.179Z] 00:10:04 INFO - expectStackToContain@/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/head_profiler.js:143:16
[task 2019-08-03T00:10:04.180Z] 00:10:04 INFO - @/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/test_merged_stacks.js:34:23
[task 2019-08-03T00:10:04.180Z] 00:10:04 INFO - async*run_next_test/_run_next_test/<@/builds/worker/workspace/build/tests/xpcshell/head.js:1564:35
[task 2019-08-03T00:10:04.180Z] 00:10:04 INFO - _run_next_test@/builds/worker/workspace/build/tests/xpcshell/head.js:1564:38
[task 2019-08-03T00:10:04.181Z] 00:10:04 INFO - run@/builds/worker/workspace/build/tests/xpcshell/head.js:732:17
[task 2019-08-03T00:10:04.181Z] 00:10:04 INFO - _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:245:6
[task 2019-08-03T00:10:04.181Z] 00:10:04 INFO - _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:572:13
[task 2019-08-03T00:10:04.182Z] 00:10:04 INFO - @-e:1:14
[task 2019-08-03T00:10:04.182Z] 00:10:04 INFO - exiting test
[task 2019-08-03T00:10:04.182Z] 00:10:04 INFO - PID 10429 | JavaScript error: resource://testing-common/PromiseTestUtils.jsm, line 112: uncaught exception: Object
[task 2019-08-03T00:10:04.183Z] 00:10:04 INFO - <<<<<<<

Summary: Intermittent TV tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true → Intermittent TV [tier2] tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true

Greg, could you please have a look?

Flags: needinfo?(gtatum)
Priority: P5 → P2
Regressed by: 1567390
Version: unspecified → 70 Branch
Summary: Intermittent TV [tier2] tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true → Intermittent tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true

This is failing because we are missing some JavaScript frames in the stack, and there are only native frames. This is either a bug where JS frames are not created, or a case where we just happen to collect a stack where there is no JavaScript stack frame present. To fix the latter, I can rewrite the test to keep on collecting a sample for N iterations, until a JS frame is present. It would also be helpful to actually symbolicate to double verify those symbols aren't an error case.

[
  "(root)",
  "xpcshell argument processing",
  "0x7f6b91df2e74",
  "0x7f6b9641a0b9",
  "0x7f6b963d2b7c",
  "0x7f6b963d2a0a",
  "js::RunScript",
  "0x7f6b94e64d0e",
  "0x7f6b94e660c2",
  "0x7f6b966261a6",
  "0x31aac439548e",
  "0x7f6b82a4fe8f",
  "0x31aac4397797",
  "0x7f6b9504e739",
  "0x7f6b94e78f68",
  "js::RunScript",
  "0x7f6b94e64d0e",
  "0x7f6b94e6eb15",
  "0x7f6b94e78fef",
  "0x7f6b94bab02e",
  "0x7f6b94ba9d58",
  "0x7f6b970afb85",
  "0x7f6b951cdf83",
  "0x7f6b94b360e5",
  "0x7f6b94b3577d",
  "0x7f6b962e3054",
  "0x563094fbd028",
  "0x7f6b9929fb1e"
]
Assignee: nobody → gtatum
Flags: needinfo?(gtatum)

I could not reproduce this on macOS, it makes me concerned that it's a bug.

I was able to reproduce this pretty consistently locally on an artifact Linux optimized build, but not on an artifact Linux debug build.

Looks like this is failing due to my use of an async function during my sample check. I'm going to rewrite things and see if it clears it up.

Attachment #9083123 - Attachment description: Bug 1571171 - Make test helper doAtLeCastOnePeriodicSample non-async; r?canaltinova → Bug 1571171 - Make test helper doAtLeastOnePeriodicSample non-async; r?canaltinova
Pushed by gtatum@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/757856705ec4
Make test helper doAtLeastOnePeriodicSample non-async; r=canaltinova
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Target Milestone: mozilla70 → ---

This is a different failure, and looks like a bug in the profiler where stack walking fails. I believe this is Bug 1434402 where we fail to stackwalk through Ion code.

[
  "(root)",
  "xpcshell argument processing",
  "js::RunScript",
  "js::RunScript",
  "XPCWrappedJS method call",
  "js::RunScript",
  "functionA (/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/test_merged_stacks.js:65:9)",
  "functionB (/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/test_merged_stacks.js:69:9)",
  "functionC (/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/test_merged_stacks.js:73:15)",
  "doAtLeastOnePeriodicSample (/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/head_profiler.js:91:9)",
  "getProfileSampleCount (/builds/worker/workspace/build/tests/xpcshell/tests/tools/profiler/tests/xpcshell/head_profiler.js:92:11)",
  "0x55c037c3ba03",
  "0x7f19af0cbaf8"
]

I'm not confident I'm going to be able to reproduce this locally. I'd be curious to see what the failure rate looks like here.

A potential fix would be attempt to de-optimize the function. If I recall correctly, putting a debugger statement in a function ensures that it will never be optimized, so perhaps that could be band-aid to make this not fail, although this is a failure case.

Flags: needinfo?(gtatum)
Flags: needinfo?(gtatum)
Summary: Intermittent tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true → Perma [tier 2] tools/profiler/tests/xpcshell/test_merged_stacks.js | - The stack contains a few frame labels, as well as the JS functions that we called. - false == true

(In reply to Alexandru Michis [:malexandru] from comment #18)

This started permafailing on central since this push:
https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=be13cb1076bc1923240b3ec450cf177d2b4ad42b

This push switches to the new profile buffer code, so it may be my fault! I'll have a look...

Flags: needinfo?(gtatum) → needinfo?(gsquelart)

The new chunk-based buffer takes the requested size as-is, and cuts it in (at least) 4 chunks. The test sets the buffer capacity to a low number, which is too small for a chunk to hold the full stack samples (which are presumably bigger on the ccov build).

I will add a generic clamping mechanism, to ensure that the profiler uses a buffer that's not too small, and not too big either.

Assignee: gtatum → gsquelart
Flags: needinfo?(gsquelart)
Regressed by: 1630872

The profiler can be given any power of two, but there were no safety checks to ensure that the buffer had a minimum workable capacity (to hold at least 4 chunks, each capable of holding at least one stack sample), and also to prevent large buffers that could break the currently-supported 2GiB limit.

This fixes the issue with test_merged_stacks.js, which was requesting a too-small buffer. (This started when we switched to the chunk-based buffer, because the profiler was blindly using the provided number as maximum, and dividing that size by 4 for each chunk, which was not enough to hold a full sample in some builds.)

Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/557f9a484473
Clamp profiler capacity to allowed values - r=canaltinova
Status: REOPENED → RESOLVED
Closed: 5 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
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: