[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/5] libqtest: always set up signal handler for SIGAB
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 5/5] libqtest: always set up signal handler for SIGABRT |
Date: |
Wed, 9 Aug 2017 04:50:59 +0300 |
From: Jens Freimann <address@hidden>
Currently abort handlers only work for the first test function
in a testcase, because the list of abort handlers is not properly
cleared when qtest_quit() is called.
qtest_quit() only deletes the kill_qemu_hook but doesn't completely
clear the abrt_hooks list. The effect is that abrt_hooks.is_setup is
never set to false and in a following test the abrt_hooks list is not
initialized and setup_sigabrt_handler() is not called.
One way to solve this is to clear the list in qtest_quit(), but
that means only asserts between qtest_start and qtest_quit will
be catched by the abort handler.
We can make abort handlers work in all cases if we always setup the
signal handler for SIGABRT in qtest_init.
Signed-off-by: Jens Freimann <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/libqtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/libqtest.c b/tests/libqtest.c
index 4a5492a..b9a1f18 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -140,8 +140,8 @@ void qtest_add_abrt_handler(GHookFunc fn, const void *data)
/* Only install SIGABRT handler once */
if (!abrt_hooks.is_setup) {
g_hook_list_init(&abrt_hooks, sizeof(GHook));
- setup_sigabrt_handler();
}
+ setup_sigabrt_handler();
hook = g_hook_alloc(&abrt_hooks);
hook->func = fn;
--
MST
- [Qemu-devel] [PULL 0/5] pc, vhost: fixes for rc3, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 1/5] acpi-test: update expected DSDT files, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 2/5] Revert "cpu: add APIs to allocate/free CPU environment", Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 3/5] net: fix -netdev socket, fd= for UDP sockets, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 4/5] libvhost-user: quit when no more data received, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 5/5] libqtest: always set up signal handler for SIGABRT,
Michael S. Tsirkin <=
- Re: [Qemu-devel] [PULL 0/5] pc, vhost: fixes for rc3, Peter Maydell, 2017/08/10