Closed Bug 990266 Opened 6 years ago Closed 6 years ago

ASan: xpcshell self-test does not symbolize on failure

Categories

(Testing :: XPCShell Harness, defect, major)

All
Linux
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: decoder, Assigned: ted)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In runxpcshelltests.py we support symbolizing with the llvm-symbolizer by looking for the symbolizer binary in the xrePath. This works on the test slaves where XPCShell tests run. However, make check also runs an xpcshell self-test on the builder and that self-test also uses the logic from runxpcshelltests.py. Therefore we need to support both binary paths (builder and tester) in that harness.
You can just grab the path using the Python buildconfig modules in the selftest script:
http://mxr.mozilla.org/mozilla-central/source/testing/xpcshell/selftest.py

It only ever runs on build machines in make check.
So I scanned through the code a bit and what I could do in selftest.py is:

> xrePath = os.path.join(objdir, "dist", "bin")
> xpcshellBin = os.path.join(xrePath, "xpcshell")

and then pass xrePath to the runTests call that goes to runxpcshelltests.py.

However, that function uses mozInfo to determine if we're in an ASan build:

>        if "asan" in self.mozInfo and self.mozInfo["asan"]:
>            # ASan symbolizer support
>            llvmsym = os.path.join(self.xrePath, "llvm-symbolizer")
> ...

and selftest.py is explicitely passing mozInfo={}.
Flags: needinfo?(ted)
Ah, okay, I unwrapped this a little in my head. I think the biggest issue here is that selftest.py just wasn't written with the expectation that it would have to deal with crashes and things like this, since it's running dead-simple tests. Sadly this isn't crashing on the test machines, so we need to fix it.

It sounds like the simple fix is just to pass mozinfo in properly in selftest.py. I'll get a patch together for that.
Assignee: choller → ted
Flags: needinfo?(ted)
This passes the selftests for me locally, and nothing else in the selftests actually depends on mozinfo, so it should be pretty safe. (We don't do any test filtering in the manifests, for example.)
Attachment #8400160 - Flags: review?(jmaher)
Comment on attachment 8400160 [details] [diff] [review]
use mozinfo in xpcshell selftests

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

this looks safe and reasonable.
Attachment #8400160 - Flags: review?(jmaher) → review+
https://hg.mozilla.org/mozilla-central/rev/6f8598224eeb
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.