From 9e56f6731eaf94daf336ab477985a257dc5aaf5c Mon Sep 17 00:00:00 2001 From: Steffen Schulz Date: Mon, 2 May 2022 08:21:53 -0700 Subject: [PATCH] fix timeout detection to only reset on VM reset reset_timeout_detection() is already called at end of NEXT_PAYLOAD handler to properly re-init the timer on every new execution. Remove the additional call in synchronization_lock() which prevents proper timeout on targets that do a lot of hprintf(). Also remove extra call in synchronization_lock_timeout_found() which really just seems to be a duplicate with no observable effect. To reproduce, run a harness that uses hprintf() in infinite loop. It will take longer due to execute due to userland overhead but should eventually return with aux_buffer/runtime similar to configured timeout. --- nyx/synchronization.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/nyx/synchronization.c b/nyx/synchronization.c index 48e758c9b4..676bb83c82 100644 --- a/nyx/synchronization.c +++ b/nyx/synchronization.c @@ -232,8 +232,6 @@ void synchronization_lock(void){ runtime_sec, runtime_usec, GET_GLOBAL_STATE()->num_dirty_pages); - reset_timeout_detector(&(GET_GLOBAL_STATE()->timeout_detector)); - if(synchronization_check_page_not_found()){ set_success_auxiliary_result_buffer(GET_GLOBAL_STATE()->auxilary_buffer, 0); } @@ -343,7 +341,6 @@ void synchronization_lock_timeout_found(void){ handle_tmp_snapshot_state(); set_timeout_auxiliary_result_buffer(GET_GLOBAL_STATE()->auxilary_buffer); - reset_timeout_detector(&(GET_GLOBAL_STATE()->timeout_detector)); perform_reload();