xpcshell eats stack for file containing head.js

NEW
Unassigned

Status

defect
5 years ago
5 years ago

People

(Reporter: tomasz, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

If you happen to have some head.js in a filename xpcshell will eat that part of stack because of this http://hg.mozilla.org/mozilla-central/file/152ef25e89ae/testing/xpcshell/head.js#l726

Example:

1. cd toolkit/components/contentprefs/tests/unit_cps2
2. break a test:
   function isomorphicDomains() {
-    yield set("a.com", "foo", 1);
+    yield set("xcom", "foo", 1)
3. mach test test_setGet.js

Result:

 0:03.33 TEST-UNEXPECTED-FAIL | self-hosted | "xcom" == "a.com" - See following stack:
self-hosted:forEach:252
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK/<:243
self-hosted:forEach:252
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK:233
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:dbOK/<.handleCompletion:260
/Users/mozilla/gecko-dev/testing/xpcshell/head.js:_do_main:191
/Users/mozilla/gecko-dev/testing/xpcshell/head.js:_execute_test:405

After removing that stack eating part we get more useful stack:

 0:03.38 TEST-UNEXPECTED-FAIL | /Users/mozilla/gecko-dev/testing/xpcshell/head.js | "xcom" == "a.com" - See following stack:
/Users/mozilla/gecko-dev/testing/xpcshell/head.js:do_check_eq:766
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK/cmp<:230
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK/</<:246
self-hosted:forEach:252
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK/<:243
self-hosted:forEach:252
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:arraysOfArraysOK:233
/Users/mozilla/gecko-dev/obj-ff-dbg/_tests/xpcshell/toolkit/components/contentprefs/tests/unit_cps2/head.js:dbOK/<.handleCompletion:260
/Users/mozilla/gecko-dev/testing/xpcshell/head.js:_do_main:191
/Users/mozilla/gecko-dev/testing/xpcshell/head.js:_execute_test:405

That code ate all stack up to "self-hosted:forEach".

Proposed solution:
check for the whole patch: "testing/xpcshell/head.js" (?)
There is the same bug for Assert.jsm (see http://hg.mozilla.org/mozilla-central/file/152ef25e89ae/testing/modules/Assert.jsm#l106). But it's not common to have that string in the filename as opposed to head.js.
Blocks: 1036639
For Assert.jsm the problem looks like this:

some_big_function_with_lots_of_asserts:method_name:line_the_method_starts
some_other_function
some_other_function

It is impossible to know from the stack trace which assertion in method_name failed.
You need to log in before you can comment on or make changes to this bug.