Last Comment Bug 816086 - B2G XPCShell: Segfault after test has finished and before next one starts
: B2G XPCShell: Segfault after test has finished and before next one starts
Status: NEW
:
Product: Testing
Classification: Components
Component: XPCShell Harness (show other bugs)
: unspecified
: ARM Gonk (Firefox OS)
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 815641 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-28 07:31 PST by Andrew Halberstadt [:ahal]
Modified: 2012-11-29 11:10 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Andrew Halberstadt [:ahal] 2012-11-28 07:31:54 PST
E.g: http://pastebin.mozilla.org/1965984
Comment 1 Ted Mielczarek [:ted.mielczarek] 2012-11-28 07:55:24 PST
This is dumping the contents of an ELF binary for some reason. (Probably xpcshell itself.)
Comment 2 Andrew Halberstadt [:ahal] 2012-11-28 08:57:54 PST
This is true for all tests, not just ones that fail. This is what's causing bug 815641 (and probably also bug 773703).

stdout is getting set here: http://hg.mozilla.org/mozilla-central/file/6c23f41b0747/testing/xpcshell/runxpcshelltests.py#l815

Since it contains gibberish and getReturnCode() just always returns 0 on b2g we never meet any of the fail conditions here: http://hg.mozilla.org/mozilla-central/file/6c23f41b0747/testing/xpcshell/runxpcshelltests.py#l830 and consequently every test is marked as PASS.

Either we aren't getting the output properly, or tests aren't running at all (or both).
Comment 3 Andrew Halberstadt [:ahal] 2012-11-28 08:59:17 PST
*** Bug 815641 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Halberstadt [:ahal] 2012-11-29 08:43:05 PST
Phew, it was a silly mistake! The desktop version of xpcshell was getting copied over instead of the arm one. Fixing that exposes a new error though:

TEST-INFO | /home/ahal/git/B2G/objdir-gecko/dist/test-package-stage/xpcshell/tests/chrome/test/unit/test_abi.js | running test ...
xpcw: cd /data/local/tests/xpcshell/chrome/test/unit
xpcw: xpcshell -r /data/local/tests/xpcshell/c/httpd.manifest -m -n -s -e const _HTTPD_JS_PATH = "/data/local/tests/xpcshell/c/httpd.js"; -e const _HEAD_JS_PATH = "/data/local/tests/xpcshell/head.js"; -e const _TESTING_MODULES_DIR = "/data/local/tests/xpcshell/m"; -f /data/local/tests/xpcshell/head.js -e const _SERVER_ADDR = "localhost" -e const _HEAD_FILES = ["/data/local/tests/xpcshell/chrome/test/unit/head_crtestutils.js"]; -e const _TAIL_FILES = []; -e const _TEST_FILE = ["test_abi.js"]; -e _execute_test(); quit(0);
/data/local/tests/xpcshell/head.js:286: Error: Specified modules directory does not exist: /data/local/tests/xpcshell/m
[1]   Segmentation fault      /data/local/test...
TEST-PASS | /home/ahal/git/B2G/objdir-gecko/dist/test-package-stage/xpcshell/tests/chrome/test/unit/test_abi.js | test passed (time: 2503.102ms)
Comment 5 Geoff Brown [:gbrown] (pto May 28-June 13) 2012-11-29 08:54:41 PST
That should be created here: https://hg.mozilla.org/mozilla-central/file/85471409cbfb/testing/xpcshell/remotexpcshelltests.py#l162
Comment 6 Andrew Halberstadt [:ahal] 2012-11-29 09:55:38 PST
Which was solved by adding --testing-modules-dir tests/modules. The tests seem to be running fine, though many (most?) have a segfault after the test finishes and before the next one starts. This is probably why we get a return code of 1 all the time (see bug 773703). Maybe this isn't causing a problem, but still worth investigating.

e.g:

TEST-INFO | /home/ahal/git/B2G/objdir-gecko/dist/test-package-stage/xpcshell/tests/chrome/test/unit/test_bug399707.js | running test ...
xpcw: cd /data/local/tests/xpcshell/chrome/test/unit
xpcw: xpcshell -r /data/local/tests/xpcshell/c/httpd.manifest -m -n -s -e const _HTTPD_JS_PATH = "/data/local/tests/xpcshell/c/httpd.js"; -e const _HEAD_JS_PATH = "/data/local/tests/xpcshell/head.js"; -e const _TESTING_MODULES_DIR = "/data/local/tests/xpcshell/m"; -f /data/local/tests/xpcshell/head.js -e const _SERVER_ADDR = "localhost" -e const _HEAD_FILES = ["/data/local/tests/xpcshell/chrome/test/unit/head_crtestutils.js"]; -e const _TAIL_FILES = []; -e const _TEST_FILE = ["test_bug399707.js"]; -e _execute_test(); quit(0);

TEST-INFO | (xpcshell/head.js) | test 1 pending
TEST-PASS | test_bug399707.js | [test_succeeded_mapping : 61] file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul == file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul
TEST-PASS | test_bug399707.js | [test_succeeded_mapping : 61] file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul == file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul
TEST-PASS | test_bug399707.js | [test_succeeded_mapping : 61] file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul == file:///data/local/tests/xpcshell/chrome/test/unit/data/test/test.xul
TEST-INFO | (xpcshell/head.js) | test 1 finished
TEST-INFO | (xpcshell/head.js) | exiting test
TEST-PASS | (xpcshell/head.js) | 3 (+ 0) check(s) passed
TEST-INFO | (xpcshell/head.js) | 0 check(s) todo
[1]   Segmentation fault      /data/local/test...
TEST-PASS | /home/ahal/git/B2G/objdir-gecko/dist/test-package-stage/xpcshell/tests/chrome/test/unit/test_bug399707.js | test passed (time: 2106.885ms)
Comment 7 Andrew Halberstadt [:ahal] 2012-11-29 10:50:39 PST
Geoff, someone mentioned this was a problem on fennec too. Have you seen segfaults like that before?
Comment 8 Geoff Brown [:gbrown] (pto May 28-June 13) 2012-11-29 11:00:19 PST
Yes, absolutely. See bug 768491...but the discussion is a little confused there. 

Summary: On Tegras, xpcshell crashes with a SIGSEGV on exit -- after main() ends. This happens every time, regardless of arguments. In fact, if I comment out the entire contents of main(), it still crashes. I have not been able to get a sensible backtrace with gdb, and don't know where the problem is. On all other devices that I have tested (Galaxy S, Android 2.3; Galaxy Nexus, 4.0.4; Pandaboard, 4.0.3?), there is no such crash.
Comment 9 Andrew Halberstadt [:ahal] 2012-11-29 11:09:14 PST
Thanks, I'll leave this open for now, but unassigning myself as I'm probably not the best person to be debugging this.
Comment 10 Andrew Halberstadt [:ahal] 2012-11-29 11:10:53 PST
I'm not sure that this blocks getting the tests running on tbpl as the segfault appears to happen after the test finishes successfully.

Note You need to log in before you can comment on or make changes to this bug.