Bug 1636859 - Shut down the `fix-stacks` child process when `fix_stacks.py` exits. r=glandium

Hopefully this will avoid some intermittent failures that occur when
`fix-stacks` is deleted at the end of a test run.

Differential Revision: https://phabricator.services.mozilla.com/D76980
This commit is contained in:
Nicholas Nethercote 2020-05-28 00:34:30 +00:00
Родитель e773557320
Коммит 9404f0620e
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -9,6 +9,7 @@
from __future__ import absolute_import, print_function
from subprocess import Popen, PIPE
import atexit
import os
import platform
import re
@ -64,6 +65,14 @@ def fixSymbols(line, jsonMode=False, slowWarning=False, breakpadSymsDir=None, hi
fix_stacks = Popen(args, stdin=PIPE, stdout=PIPE, stderr=stderr)
# Shut down the fix_stacks process on exit. We use `terminate()`
# because it is more forceful than `wait()`, and the Python docs warn
# about possible deadlocks with `wait()`.
def cleanup(fix_stacks):
fix_stacks.stdin.close()
fix_stacks.terminate()
atexit.register(cleanup, fix_stacks)
if slowWarning:
print("Initializing stack-fixing for the first stack frame, this may take a while...")