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

Frediano Ziglio fziglio at redhat.com
Thu Jan 28 06:58:59 PST 2016



----- Original Message -----
> From: "Christophe Fergeau" <cfergeau at redhat.com>
> To: "Frediano Ziglio" <fziglio at redhat.com>
> Cc: spice-devel at lists.freedesktop.org
> Sent: Thursday, January 28, 2016 2:55:04 PM
> Subject: Re: [Spice-devel] [PATCH] tests: exit on SIGABRT
> 
> Hey,
> 
> On Thu, Jan 28, 2016 at 02:22:22PM +0000, Frediano Ziglio wrote:
> > Fatal error exit usually with abort() causing SIGABRT to be triggered
> > which can have problems with core dump degeration depending on system
> 
> degeration? generation?
> 

Yes, sorry, was a typo.

> > settings. Capturing and exiting on this signal solve the problem.
> 
> I find it quite surprising that core dump generation can prevent the
> test cases from working, and that we need to add one layer of SIGABRT
> interception to get things working :(
> 
> Christophe
> 

The problem is that there is too much possible settings for core
generation (ehmm degeration :) ).

Frediano

> > 
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  tests/test-logging.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/tests/test-logging.c b/tests/test-logging.c
> > index 008ce48..dad7a60 100644
> > --- a/tests/test-logging.c
> > +++ b/tests/test-logging.c
> > @@ -376,11 +376,17 @@ 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;
> >  
> > +    signal(SIGABRT, handle_sigabrt);
> > +
> >      fatal_mask = (GLogLevelFlags)g_log_set_always_fatal((GLogLevelFlags)
> >      G_LOG_FATAL_MASK);
> >  
> >      g_test_init(&argc, &argv, NULL);
> > --
> > 2.4.3
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list