Assertion failure in VCL_DelBackend()

Geoff Simmons geoff at uplex.de
Sun Nov 15 23:02:46 CET 2015


Hello all,

The patch and test case in the attachment demonstrate VCL_DelBackend()
crashing on assertion failure, at least when called from a VMOD. It's
failing AN(ptr) on line 288 of common/common_vsm.c, because be->vsc is
NULL (VSM_Free(be->vsc) called by VBE_Event()).

The crash happens when you attempt to remove a statically declared
backend. Oddly, I seem to have no problem at all calling
VCL_DelBackend() on a dynamic backend created within the VMOD (using
VRT_new_backend()).

Bug report? (Are we still using trac for that, or are we into the Brave
New World now?)

I've noticed a few other strange things about VCL_DelBackend:

- n_backend is evidently not decremented
- the deleted backend still appears in the output of backend.list


Best,
Geoff
-- 
** * * UPLEX - Nils Goroll Systemoptimierung

Scheffelstraße 32
22301 Hamburg

Tel +49 40 2880 5731
Mob +49 176 636 90917
Fax +49 40 42949753

http://uplex.de
-------------- next part --------------
varnishtest "VCL_DelBackend"

server s1 {
} -start

varnish v1 -vcl {
	import ${vmod_debug};

	backend s1 { .host="${s1_addr}"; .port="${s1_port}"; }

	sub vcl_recv {
		if (req.method == "DELETE") {
			if (debug.delete(s1)) {
				return(synth(204, "No Content"));
			}
			else {
				return(synth(404, "Not found"));
			}
		}
	}
} -start

client c1 {
	txreq -req "DELETE"
	rxresp
	expect resp.status == 204
	txreq -req "DELETE"
	rxresp
	expect resp.status == 404
} -run
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VCL_DelBackend.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20151115/f1b9f833/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20151115/f1b9f833/attachment.pgp>


More information about the varnish-dev mailing list