diff options
author | William Cohen <wcohen@redhat.com> | 2011-03-09 16:56:03 -0500 |
---|---|---|
committer | William Cohen <wcohen@redhat.com> | 2011-03-09 16:56:03 -0500 |
commit | 9e0b7610c433725222171e342029bf201a37111b (patch) | |
tree | 5952053bbfa01b7f229cf661042a81e3ecbd438d | |
parent | 38aaf311fb74384076b6c7cde68f8f66052e5e77 (diff) | |
download | memstomp-9e0b7610c433725222171e342029bf201a37111b.tar.gz memstomp-9e0b7610c433725222171e342029bf201a37111b.tar.xz memstomp-9e0b7610c433725222171e342029bf201a37111b.zip |
Support for ABRT
ABRT is a package that allows automated reported of problems on the system.
ABRT watches for programs exiting as a result of a SIGSEGV and whether the
executable belongs a package. If both conditions are true then, the ABRT
applet can assist in report a bug.
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | memstomp.c | 8 |
2 files changed, 7 insertions, 4 deletions
@@ -24,6 +24,9 @@ NOTES: situations where locks are taken or memory allocated as we do it here. YMMV. + memstomp also has a '--kill' option that kills the application + at the first problem memcpy. + Note that valgrind can perform this type of check also. memstomp merely lowers the overhead for this type of check. @@ -44,9 +44,9 @@ #endif #include <signal.h> -#define KILL_TRAP raise(SIGABRT) +#define ABRT_TRAP raise(SIGSEGV) -static bool kill_trap = false; +static bool abrt_trap = false; #ifndef SCHED_RESET_ON_FORK /* "Your libc lacks the definition of SCHED_RESET_ON_FORK. We'll now @@ -172,7 +172,7 @@ static void setup(void) { "memstomp: useful stack traces.\n\n"); if (getenv("MEMSTOMP_KILL")) - kill_trap = true; + abrt_trap = true; initialized = true; @@ -323,7 +323,7 @@ void * memcpy(void * dest, const void * src, size_t count) /* Check for overlap. */ if (distance < count) { - if (kill_trap) KILL_TRAP; + if (abrt_trap) ABRT_TRAP; /* report the overlap */ warn_memcpy(dest, src, count); } |