summary refs log tree commit diff stats
path: root/docs/devel/secure-coding-practices.rst
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-01-13 12:01:20 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-02-11 09:20:38 +0100
commit12008ff748d8cfb62fb937559c0fd844371bab5e (patch)
tree0eb0416e451aecf9edbe32b5db20dd2f9bfdce3f /docs/devel/secure-coding-practices.rst
parent786c5256d3262518d8805ac2a62eb1c4a3813b80 (diff)
downloadfocaccia-qemu-12008ff748d8cfb62fb937559c0fd844371bab5e.tar.gz
focaccia-qemu-12008ff748d8cfb62fb937559c0fd844371bab5e.zip
libqtest: ensure waitpid() is only called once
If a test aborts after qtest_wait_qemu() is called, the SIGABRT hooks are
still in place and waitpid() is called again.  The second time it is called,
the process does not exist anymore and the system call fails.

Move the s->qemu_pid = -1 assignment to qtest_wait_qemu() to make it
idempotent, and anyway remove the SIGABRT hook as well to avoid that
qtest_check_status() is called twice.  Because of the extra call,
qtest_remove_abrt_handler() now has to be made idempotent as well.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/devel/secure-coding-practices.rst')
0 files changed, 0 insertions, 0 deletions