From 982dd051ae28cc251d480b7141c39664975a67e9 Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Thu, 21 May 2026 16:32:52 +0000 Subject: [PATCH] DAOS-18859 test: add diagnostic logging for stale evp condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add D_ERROR + fprintf(stderr) diagnostic messages in kv_put() and kv_get() that fire when daos_eq_poll() returns rc < 0 (poll error) and the code is about to dereference the stale evp pointer. This commit does NOT fix the bug — it only makes it visible in CI logs. When triggered, the messages confirm the stale-evp condition occurred, helping correlate with subsequent SIGSEGV or ASAN errors. Quick-Functional: true Test-repeat: 5 Test-tag: PoolAutotestTest,test_pool_autotest Signed-off-by: Cedric Koch-Hofer --- src/utils/daos_autotest.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/utils/daos_autotest.c b/src/utils/daos_autotest.c index 5d9f591b7fa..3aaf0350e92 100644 --- a/src/utils/daos_autotest.c +++ b/src/utils/daos_autotest.c @@ -1,6 +1,6 @@ /** * (C) Copyright 2020-2022 Intel Corporation. - * (C) Copyright 2025 Hewlett Packard Enterprise Development LP + * (C) Copyright 2025-2026 Hewlett Packard Enterprise Development LP * * SPDX-License-Identifier: BSD-2-Clause-Patent */ @@ -498,6 +498,24 @@ kv_put(daos_handle_t oh, daos_size_t size) } } + /** + * DAOS-18859 diagnostic: when rc < 0, evp was NOT + * updated by daos_eq_poll — it is stale. + */ + if (rc < 0) { + D_ERROR("DAOS-18859 kv_put: daos_eq_poll " + "returned " DF_RC ", evp is stale" + " — will dereference invalid" + " pointer!\n", + DP_RC(rc)); + fprintf(stderr, + "DAOS-18859 kv_put:" + " daos_eq_poll returned %d, evp is" + " stale — will dereference invalid" + " pointer!\n", + rc); + } + /** Check if completed operation failed */ if (evp->ev_error != DER_SUCCESS) { rc = evp->ev_error; @@ -638,6 +656,24 @@ kv_get(daos_handle_t oh, daos_size_t size) } } + /** + * DAOS-18859 diagnostic: when rc < 0, evp was NOT + * updated by daos_eq_poll — it is stale. + */ + if (rc < 0) { + D_ERROR("DAOS-18859 kv_get: daos_eq_poll " + "returned " DF_RC ", evp is stale" + " — will dereference invalid" + " pointer!\n", + DP_RC(rc)); + fprintf(stderr, + "DAOS-18859 kv_get:" + " daos_eq_poll returned %d, evp is" + " stale — will dereference invalid" + " pointer!\n", + rc); + } + /** Check if completed operation failed */ if (evp->ev_error != DER_SUCCESS) { rc = evp->ev_error;