Instability when using management CLI

Kristoffer Gleditsch kristoffer.gleditsch at
Tue Mar 27 14:27:19 CEST 2007


We're currently testing Varnish in front of a new content generation
system.  This system doesn't know exactly how long the pages it
generates will be valid, but it is important to purge them from the
cache once new data is available.  In order to do this, we're connecting
to the CLI on the administration port, and issuing url.purge commands.

Once the purge commands started pouring in, we found some stability
issues; Within a few minutes, Varnish would segfault in strange places,
or in some cases just keep using 100% CPU without any interaction with
anyone.  ElectricFence gave me a segfault on this line:

(The file doesn't seem to have changed between 1.0.3 and trunk.)

I'm not sure I understand every aspect of this function, but I'm unable
to see where the space for that extra newline is allocated, and
re-compiling version 1.0.3 with the attached patch seems to have
stabilized it.  It has now been processing some thousands of purge
requests for almost 24 hours under ElectricFence without incident.

I also tried running it through Valgrind.  It complained about lost
memory in several places.  Would these Valgrind logs be useful to
anyone, or should I just try patching Varnish myself instead?  :)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: varnish-malloc.patch
Type: text/x-patch
Size: 407 bytes
Desc: not available
URL: <>

More information about the varnish-dev mailing list