diff --git a/src/main/exec.c b/src/main/exec.c diff --git a/src/main/threads.c b/src/main/threads.c index 72d849f..0f80e3c 100644 --- a/src/main/threads.c +++ b/src/main/threads.c @@ -272,7 +272,21 @@ static void reap_children(void) mytf.pid = pid; tf = fr_hash_table_finddata(thread_pool.waiters, &mytf); - if (!tf) goto retry; + if (!tf) { + radlog(L_INFO, "could not find pid %d in hash table, adding it.", pid); + tf = rad_malloc(sizeof(*tf)); + memset(tf, 0, sizeof(*tf)); + + tf->pid = pid; + + int rcode = fr_hash_table_insert(thread_pool.waiters, tf); + if (!rcode) { + radlog(L_ERR, "Failed to store PID %d, process will time out ", + (int) pid); + free(tf); + goto retry; + } + } tf->status = status; tf->exited = 1; @@ -1208,6 +1222,7 @@ pid_t rad_waitpid(pid_t pid, int *status) * 10 seconds have passed, give up on the child. */ pthread_mutex_lock(&thread_pool.wait_mutex); + radlog(L_INFO, "10 seconds have passed, give up on the child pid %d", pid); fr_hash_table_delete(thread_pool.waiters, &mytf); pthread_mutex_unlock(&thread_pool.wait_mutex); diff --git a/src/modules/rlm_mschap/rlm_mschap.c b/src/modules/rlm_mschap/rlm_mschap.c