mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-09-01 06:41:30 +00:00
Try outputting core dump when multiprocessing spawn segfaults
This commit is contained in:
parent
7821ae39ab
commit
86c59016c6
1 changed files with 13 additions and 1 deletions
|
|
@ -67,13 +67,25 @@ def get_process_pool_executor(
|
|||
|
||||
def test_spawn() -> None:
|
||||
monkey_patch_multiprocessing()
|
||||
import shutil
|
||||
import subprocess
|
||||
from queue import Empty
|
||||
try:
|
||||
from multiprocessing import get_context
|
||||
ctx = get_context('spawn')
|
||||
q = ctx.Queue()
|
||||
p = ctx.Process(target=q.put, args=('hello',))
|
||||
p.start()
|
||||
x = q.get(timeout=8)
|
||||
try:
|
||||
x = q.get(timeout=8)
|
||||
except Empty:
|
||||
p.join()
|
||||
rc = p.exitcode
|
||||
if rc == 0:
|
||||
raise TimeoutError('Timed out waiting for response from spawned process')
|
||||
if shutil.which('coredumpctl'):
|
||||
subprocess.run(['sh', '-c', 'echo bt | coredumpctl debug'])
|
||||
raise SystemExit(f'Spawned process exited with return code: {rc}')
|
||||
assert x == 'hello'
|
||||
p.join()
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue