[vlc-devel] [PATCH 1/2] test: dump core on timeout

Rémi Denis-Courmont remi at remlab.net
Tue Nov 27 19:42:06 CET 2018


Le tiistaina 27. marraskuuta 2018, 16.02.18 EET Thomas Guillem a écrit :
> ---
>  test/libvlc/test.h | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/test/libvlc/test.h b/test/libvlc/test.h
> index 57bf787514..641e52d688 100644
> --- a/test/libvlc/test.h
> +++ b/test/libvlc/test.h
> @@ -41,7 +41,7 @@
>  #include <stdlib.h>
>  #include <stdbool.h>
>  #include <unistd.h>
> -
> +#include <signal.h>
> 
>  /*********************************************************************
>   * Some useful global var
> @@ -65,6 +65,13 @@ static const char test_default_video[] =
> SRCDIR"/samples/image.jpg";
> 
>  #define test_log( ... ) printf( "testapi: " __VA_ARGS__ );
> 
> +static inline void on_sigalrm(int signum)
> +{
> +    fprintf(stderr, "ERROR: test timeout\n");
> +    /* Raise SIGABRT in order to cause a core dump */
> +    raise(SIGABRT);
> +}
> +

UB / not signal-safe.

-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list