Fix bug in OSX crashdump analysis. Add field for child start time.
diff --git a/arch_mac.c b/arch_mac.c
index 85ff0ec..cca0090 100644
--- a/arch_mac.c
+++ b/arch_mac.c
@@ -325,7 +325,22 @@
pid_t arch_reapChild(honggfuzz_t * hfuzz)
{
- int status;
+ /*
+ * First check manually if we have expired childs
+ */
+
+ for (int idx = 0; idx < hfuzz->threadsMax; idx++) {
+ double diff = difftime(time(NULL), hfuzz->fuzzers[idx].timeStarted);
+ if (hfuzz->fuzzers[idx].pid != 0 && diff > (double)hfuzz->tmOut) {
+ LOGMSG(l_WARN, "Process pid %d is overdue (%f seconds, max %f seconds %f), sending a SIGKILL", hfuzz->fuzzers[idx].pid, diff, (double)hfuzz->tmOut);
+ kill(hfuzz->fuzzers[idx].pid, SIGKILL);
+ }
+ }
+
+ /*
+ * Now check for signals using wait3
+ */
+ int status = 0;
struct rusage ru;
pid_t pid = wait3(&status, 0, &ru);
@@ -448,7 +463,7 @@
char *description = (char *)[crashDescription UTF8String];
/* The callstack begins with the following word */
- char *callstack = strstr(description, "Crashed::");
+ char *callstack = strstr(description, "Crashed:");
if (callstack == NULL) {
LOGMSG(l_FATAL, "Could not find callstack in crash report %s", description);