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

Rémi Denis-Courmont remi at remlab.net
Wed Nov 28 10:15:41 CET 2018


alarm() always works. VLC timer can get corrupted on bugs. So rather not.

Le 28 novembre 2018 11:03:53 GMT+02:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>
>
>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
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20181128/0edb5647/attachment.html>


More information about the vlc-devel mailing list