Rework corewatcher, clean valgrind warnings.
Major rework of corewatcher. Corewatcher is now multithreaded
and will spawn a thread to process each corefile and will now
send a crash notification as soon it scans the /tmp/ folder.
There should be no more than one thread running gdb at a time
so we have a global lock to prevent that.
Corewatcher was also cleaned up to have 0 valgrind errors
(that are not suppressed, we have added a valgrind suppression
file for that purpose).
From here on any changes to corewatcher which cause a valgrind
error need to be discussed before being commited and ack'd
by a maintainer (and have its error added to the suppression
file). Right now all suppressions are either glibc not doing
things that are not ansi c compliant or are in a library
corewatcher depends on (likely also running into glibc compliance
issues but I was unable to verify for all of the errors).
To test corewatcher for valgrind errors it should be run in
with no internet connection and with an internet connection
with multiple core files available to scan.
The following command should be used to test corewatcher with
valgrind (run from the source build directory):
G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind \
--partial-loads-ok=yes --read-var-info=yes --leak-check=full \
--track-origins=yes --malloc-fill=AD --free-fill=DA \
--suppressions=./corewatcher.supp --gen-suppressions=yes \
./corewatcher -d -n
Signed-off-by: William Douglas <william.douglas@intel.com>