This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 97f791f2a4623ae9ac218e460400c69b00964622
Author: Chris McFarlen <[email protected]>
AuthorDate: Mon Aug 18 11:55:38 2025 -0500

    Fix a crash due to unsatisfied precondition (#12449)
    
    * Fix a crash due to unsatisfied precondition
    
    * Check for dummy port before failing
    
    (cherry picked from commit f1870950be554fceb40e100eb073fd3bc6cefbbf)
---
 src/api/InkAPITest.cc         | 8 +++++---
 src/iocore/cache/CacheTest.cc | 3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/api/InkAPITest.cc b/src/api/InkAPITest.cc
index d174fc6a13..b0467e71bc 100644
--- a/src/api/InkAPITest.cc
+++ b/src/api/InkAPITest.cc
@@ -917,9 +917,11 @@ synserver_vc_accept(TSCont contp, TSEvent event, void 
*data)
   TSAssert(s->magic == MAGIC_ALIVE);
 
   if (event == TS_EVENT_NET_ACCEPT_FAILED) {
-    Warning("Synserver failed to bind to port %d.", ntohs(s->accept_port));
-    ink_release_assert(!"Synserver must be able to bind to a port, check 
system netstat");
-    Dbg(dbg_ctl_SockServer, "%s: NET_ACCEPT_FAILED", __func__);
+    if (s && s->accept_port != SYNSERVER_DUMMY_PORT) {
+      Warning("Synserver failed to bind to port %d.", ntohs(s->accept_port));
+      ink_release_assert(!"Synserver must be able to bind to a port, check 
system netstat");
+      Dbg(dbg_ctl_SockServer, "%s: NET_ACCEPT_FAILED", __func__);
+    }
     return TS_EVENT_IMMEDIATE;
   }
 
diff --git a/src/iocore/cache/CacheTest.cc b/src/iocore/cache/CacheTest.cc
index 0cbf0df6cb..492dd74597 100644
--- a/src/iocore/cache/CacheTest.cc
+++ b/src/iocore/cache/CacheTest.cc
@@ -449,7 +449,8 @@ 
REGRESSION_TEST(cache_disk_replacement_stability)(RegressionTest *t, int level,
 
   *pstatus = REGRESSION_TEST_INPROGRESS;
 
-  disk.num_errors = 0;
+  disk.num_errors       = 0;
+  disk.hash_base_string = ats_strdup("placeholder");
 
   for (int i = 0; i < MAX_VOLS; ++i) {
     stripes[i]     = new StripeSM{&disk, 
static_cast<off_t>(DEFAULT_STRIPE_SIZE / STORE_BLOCK_SIZE), 0};

Reply via email to