gecko-dev/memory/replace
Nicholas Nethercote 88cd51aa6d Bug 1628527 - Introduce explicit initialization and finalization of fix-stacks. r=erahm,perftest-reviewers,sparky,gbrown
Currently AWSY-with-DMD doesn't work on Windows. This is because `fix-stacks`
is initialized lazily, and by the time the initialization happens some file
descriptors for files are open, and that leads to some major Python2-on-Windows
sadness as described in the big comment in the commit.

To fix the problem, this commit adds an `init` function to `fix_stacks.py` so
that `fix-stacks` can be initialized eagerly, hopefully before any file
descriptors for files are open.

For `dmd.py`, other than fixing the AWSY problems, this has little effect,
because `fix-stacks` is always initialized.

For `utils.py`, which is used to process the output of most tests, this has a
more noticeable effect: the `fix-stacks` process is always spawned, rather than
being spawned only when needed. If no stack traces appear in the test output,
this means that `fix-stacks` is spawned unnecessarily. But it's cheap to spawn;
the expensive part only happens when stack traces start getting fixed. So I
think this change in behaviour is acceptable.

Furthermore, the commit adds a `finish` function to `fix_stacks.py`, so that
the `fix-stacks` process can be explicitly shut down. This has never been done
for processes spawned for any of the stack fixing scripts. It's never caused
problems on Linux/Mac, but it seems to be necessary on Windows to avoid
similar "this file is locked" problems with the test_dmd.js test.

The commit also renames some things to more standard Python style, e.g.
`json_mode` instead of `jsonMode`.

Finally, Android tests use `utils.py` from the repository but `fix_stacks.py`
from the Android host utils. Because the two scripts must be updated in tandem,
this commit also updates the Android host utils to a version that contains the
updated `fix_stacks.py`. Thanks to aerickson for packaging up the new Android
host utils and providing the change to the `hostutils.manifest` file.

Differential Revision: https://phabricator.services.mozilla.com/D69478
2020-04-20 22:43:25 +00:00
..
dmd Bug 1628527 - Introduce explicit initialization and finalization of fix-stacks. r=erahm,perftest-reviewers,sparky,gbrown 2020-04-20 22:43:25 +00:00
logalloc Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown 2020-02-27 17:39:15 +00:00
phc Bug 1519636 - Reformat recent changes to the Google coding style r=jgilbert 2020-04-05 13:34:58 +00:00
moz.build Bug 1523276 - Implement PHC, a probabilistic heap checker. r=glandium,gsvelto 2019-07-03 09:26:11 +10:00