Rework corewatcher, clean valgrind warnings.
authorWilliam Douglas <william.douglas@intel.com>
Sat, 9 Jul 2011 00:21:06 +0000 (17:21 -0700)
committerWilliam Douglas <william.douglas@intel.com>
Fri, 22 Jul 2011 00:33:18 +0000 (17:33 -0700)
commit76f3a1ae633ab45ccb6dcf7c785d4aa204e04d9c
tree96e9707e6500fb27bc45cbab52374a7ec7f3ed17
parent20a8e2092ce58b688ae46c5f8e2fd52d39b8252e
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>
Makefile
configfile.c
coredump.c
corewatcher.c
corewatcher.h
corewatcher.supp [new file with mode: 0644]
find_file.c
submit.c