From d90a4dd6e9e7d0ac22574ec76fd8ccdfcb8f00bb Mon Sep 17 00:00:00 2001 From: Manik Jain Date: Tue, 30 Apr 2024 18:55:36 +0000 Subject: [PATCH] Fix arithmetic exception caused by uninitialized checkpoint freq --- src/disco/tvu/fd_tvu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/disco/tvu/fd_tvu.c b/src/disco/tvu/fd_tvu.c index 367ba74a43..b47f491b36 100644 --- a/src/disco/tvu/fd_tvu.c +++ b/src/disco/tvu/fd_tvu.c @@ -714,6 +714,7 @@ void solcap_setup( char const * capture_fpath, fd_valloc_t valloc, solcap_setup_ void capture_ctx_setup( fd_runtime_ctx_t * runtime_ctx, fd_runtime_args_t * args, solcap_setup_t * solcap_setup_out, fd_valloc_t valloc ) { + /* TODO: needs a refactor */ runtime_ctx->capture_ctx = NULL; runtime_ctx->capture_file = NULL; @@ -726,7 +727,6 @@ void capture_ctx_setup( fd_runtime_ctx_t * runtime_ctx, fd_runtime_args_t * args runtime_ctx->capture_ctx->checkpt_path = NULL; runtime_ctx->capture_ctx->checkpt_slot = 0; - runtime_ctx->capture_ctx->checkpt_freq = ULONG_MAX; runtime_ctx->capture_ctx->pruned_funk = NULL; } @@ -747,6 +747,10 @@ void capture_ctx_setup( fd_runtime_ctx_t * runtime_ctx, fd_runtime_args_t * args runtime_ctx->capture_ctx->capture = NULL; } + if ( runtime_ctx->capture_ctx ) { + runtime_ctx->capture_ctx->checkpt_freq = ULONG_MAX; + } + if ( has_checkpt_dump ) { runtime_ctx->capture_ctx->checkpt_slot = args->checkpt_slot; runtime_ctx->capture_ctx->checkpt_path = args->checkpt_path;