mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 1279108 - Disable leak detection for updater xpcshell tests. r=mccr8
With more recent version of ASAN, the updater program shows multiple leaks, for different reasons. One is that the updater code heavily relies on pointers into a large buffer, with exceptions, making things difficult to avoid leaks of those exceptions. At least it requires more effort than I'm willing to put for the sake of upgrading the compiler we use for ASAN. Another is that the leak suppressions are not currently used for xpcshell tests, and some leaks attributed to libglib, that would normally be suppressed, are not. Moreover, even if the suppressions were used, it looks like some are not rooted to already suppressed system libraries, and would require investigation. Ideally, we'd have debug symbols installed for the system libraries and would have full stack traces, but we don't, so this makes the whole process harder than necessary. All in all, the updater is a separate short-lived program, and until we can address all the problems above, we can just ignore memory leaks in it (which aren't new anyways and are ignored by not being detected by the ASAN currently used on automation). We don't disable ASAN entirely, though, only leak detection, and only for the updater program.
This commit is contained in:
parent
9ae35b95e7
commit
d1d2409fb5
@ -1783,11 +1783,28 @@ function runUpdateUsingUpdater(aExpectedStatus, aSwitchApp, aExpectedExitValue)
|
||||
args = args.concat(gCallbackArgs);
|
||||
debugDump("running the updater: " + updateBin.path + " " + args.join(" "));
|
||||
|
||||
// See bug 1279108.
|
||||
// nsIProcess doesn't have an API to pass a separate environment to the
|
||||
// subprocess, so we need to alter the environment of the current process
|
||||
// before launching the updater binary.
|
||||
let env = Cc["@mozilla.org/process/environment;1"].
|
||||
getService(Ci.nsIEnvironment);
|
||||
let asan_options = null;
|
||||
if (env.exists("ASAN_OPTIONS")) {
|
||||
asan_options = env.get("ASAN_OPTIONS");
|
||||
env.set("ASAN_OPTIONS", asan_options + ":detect_leaks=0")
|
||||
} else {
|
||||
env.set("ASAN_OPTIONS", "detect_leaks=0")
|
||||
}
|
||||
|
||||
let process = Cc["@mozilla.org/process/util;1"].
|
||||
createInstance(Ci.nsIProcess);
|
||||
process.init(updateBin);
|
||||
process.run(true, args, args.length);
|
||||
|
||||
// Restore previous ASAN_OPTIONS if there were any.
|
||||
env.set("ASAN_OPTIONS", asan_options ? asan_options : "");
|
||||
|
||||
let status = readStatusFile();
|
||||
if (process.exitValue != aExpectedExitValue || status != aExpectedStatus) {
|
||||
if (process.exitValue != aExpectedExitValue) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user