[Spice-devel] [PATCH] tests: exit on SIGABRT

Christophe Fergeau cfergeau at redhat.com
Fri Mar 11 11:12:36 UTC 2016


On Fri, Mar 11, 2016 at 05:42:15AM -0500, Frediano Ziglio wrote:
> Fatal error exit usually with abort() causing SIGABRT to be triggered
> which can have problems with core dump generation depending on system
> settings. Capturing and exiting on this signal solve the problem.
> This is a workaround to some system configurations which could cause
> test to fail.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  tests/test-logging.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/test-logging.c b/tests/test-logging.c
> index 94e923a..046ab80 100644
> --- a/tests/test-logging.c
> +++ b/tests/test-logging.c
> @@ -377,11 +377,19 @@ static void test_spice_g_messages_debug_all(void)
>      g_test_trap_assert_stderr("*g_message\n*other_message\n");
>  }
>  
> +static void handle_sigabrt(int sig)
> +{
> +    _Exit(1);
> +}
>  
>  int main(int argc, char **argv)
>  {
>      GLogLevelFlags fatal_mask;
>  
> +    /* prevents core generations as this could cause some issues/timeout
> +     * due to system configurations */

'depending on system configuration' would be clearer I think

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160311/837bbcf6/attachment-0001.sig>


More information about the Spice-devel mailing list