[PATCH libinput 1/2] test: disable coredumps during test suite runs

Peter Hutterer peter.hutterer at who-t.net
Mon May 8 10:49:55 UTC 2017


On Mon, May 08, 2017 at 12:01:05PM +0300, Pekka Paalanen wrote:
> On Mon, 8 May 2017 18:35:33 +1000
> Peter Hutterer <peter.hutterer at who-t.net> wrote:
> 
> > On Mon, May 08, 2017 at 02:12:02PM +1000, Peter Hutterer wrote:
> > > Running valgrind through mesontest produces coredumps for a lot of tests
> > > (unclear why, the core dump merely shows a call to abort). But even without
> > > mesontest, creating a core dump for each failed test is a bad idea - if one
> > > fails, most likely many others fail and the coredumps quickly fill up the file
> > > system.
> > > 
> > > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > > ---
> > >  test/litest.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > diff --git a/test/litest.c b/test/litest.c
> > > index 9eadc459..62e86da7 100644
> > > --- a/test/litest.c
> > > +++ b/test/litest.c
> > > @@ -39,6 +39,7 @@
> > >  #include <unistd.h>
> > >  #include "linux/input.h"
> > >  #include <sys/ptrace.h>
> > > +#include <sys/resource.h>
> > >  #include <sys/sendfile.h>
> > >  #include <sys/timerfd.h>
> > >  #include <sys/wait.h>
> > > @@ -3581,6 +3582,7 @@ litest_list_tests(struct list *tests)
> > >  int
> > >  main(int argc, char **argv)
> > >  {
> > > +	const struct rlimit corelimit = { 0, 0 };
> > >  	enum litest_mode mode;
> > >  
> > >  	list_init(&all_tests);
> > > @@ -3619,6 +3621,9 @@ main(int argc, char **argv)
> > >  		return EXIT_SUCCESS;
> > >  	}
> > >  
> > > +	if (setrlimit(RLIMIT_CORE, &corelimit) == 0)  
> > 
> > and this should of course be != 0, I accidentally committed the test diff,
> > sorry.
> 
> Hi,
> 
> if I'm reading 'man systemd-coredump' right, this should also prevent
> cluttering the stored coredump list with test suite cores. I recall
> someone complaining about running test suites (wayland? weston?
> libinput?) that they clutter the output of 'coredumpctl'.

heh. I disabled coredumpctl ages ago for other reasons, so I never noticed.
that complaint unfortunately never made it to me, I just noticed my fs
filling up with hundreds of vgcore.12345 files.
 
> So I think this is a good idea for all test suites.

true, I'll add this to libevdev and whatever else I'm maintaining.
thanks!

Cheers,
   Peter

> 
> 
> Thanks
> pq
> 
> 
> > > +		perror("WARNING: Core dumps not disabled. Reason");
> > > +
> > >  	return litest_run(argc, argv);
> > >  }
> > >  #endif
> > > -- 
> > > 2.12.2
> > >   
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 




More information about the wayland-devel mailing list