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

Thomas Guillem thomas at gllm.fr
Wed Nov 28 10:03:53 CET 2018



On Tue, Nov 27, 2018, at 19:42, Rémi Denis-Courmont wrote:
> 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.

Ah yes, I checked that raise() is async-signal-safe and then added  fprintf() at the last time.
So, I must remove the fprintf.

What about just using vlc_timer ? This will be a first step to have tests on win32.

> 
> -- 
> Реми Дёни-Курмон
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list