[master] 87ab209 Volatile read of the VCL temperature

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 9 18:50:16 CEST 2016

commit 87ab209018ac3b6f18d29ba27de78e34a47bf03b
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Aug 30 21:37:34 2016 +0200

    Volatile read of the VCL temperature
    There is currently no locking around temperature changes despite the
    fact that it may be read outside of the CLI thread to make decisions.
    In the case of a panic, instead of locking we simply make sure not to
    perform an incomplete read of the pointer.

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index e4daeea..a7ad58b 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -127,7 +127,7 @@ VCL_Panic(struct vsb *vsb, const struct vcl *vcl)
 	VSB_printf(vsb, "busy = %u\n", vcl->busy);
 	VSB_printf(vsb, "discard = %u,\n", vcl->discard);
 	VSB_printf(vsb, "state = %s,\n", vcl->state);
-	VSB_printf(vsb, "temp = %s,\n", vcl->temp);
+	VSB_printf(vsb, "temp = %s,\n", (const volatile char *)vcl->temp);
 	VSB_printf(vsb, "conf = {\n");
 	VSB_indent(vsb, 2);
 	if (vcl->conf == NULL) {

More information about the varnish-commit mailing list