[master] 20319dd Fix missing clearing of oc->busyobj on HSH_Fail.

Martin Blix Grydeland martin at varnish-software.com
Mon Mar 31 14:58:05 CEST 2014


commit 20319dd6e73e2979948468f49ed11cb7a00a6156
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Mar 31 14:51:19 2014 +0200

    Fix missing clearing of oc->busyobj on HSH_Fail.
    
    The oc's busyobj isn't cleared in HSH_Fail (like it is in HSH_Complete).
    This allows a thread to get a pointer to an already free'd busyobj.
    
    Fixes: #1467

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 775d66c..54a042d 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -790,6 +790,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
 				assert(uu == bo->fetch_obj->len);
 		}
 	}
+	AZ(bo->fetch_objcore->busyobj);
 
 	if (bo->ims_obj != NULL)
 		(void)HSH_DerefObj(&wrk->stats, &bo->ims_obj);
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 1530937..f4bbae0 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -642,6 +642,7 @@ HSH_Fail(struct objcore *oc)
 
 	Lck_Lock(&oh->mtx);
 	oc->flags |= OC_F_FAILED;
+	oc->busyobj = NULL;
 	Lck_Unlock(&oh->mtx);
 }
 



More information about the varnish-commit mailing list