[Varnish] #196: Varnish crashes in ses_sum_acct (cache_session.c)

Varnish varnish-bugs at projects.linpro.no
Fri Jan 11 18:02:59 CET 2008


#196: Varnish crashes in ses_sum_acct (cache_session.c)
----------------------+-----------------------------------------------------
 Reporter:  anders    |       Owner:  phk                                            
     Type:  defect    |      Status:  new                                            
 Priority:  normal    |   Milestone:                                                 
Component:  varnishd  |     Version:  1.2                                            
 Severity:  normal    |    Keywords:  varnishd core dump ses_sum_acct cache_session.c
----------------------+-----------------------------------------------------
 Varnish crashes with this error message:

 Cache child died pid=46980 status=0x8b
 Clean child

 I am running Varnish 1.2 branch up to date to commit 2337, on
 FreeBSD/amd64 6.3-RC2 (on Intel (EMT64) hardware).

 My VCL:

 {{{
 backend default {
              set backend.host = "192.168.110.1";
              set backend.port = "80";
         }
 acl purge {
         "192.168.100.1"/32;
 }

 sub vcl_recv {
         if (req.http.host ~ "^(bars.*.foo.no|bazcache.foo.no)$") {
                 if (req.request == "GET" || req.request == "HEAD") {
                         lookup;
                 } elsif (req.request ~ "^(PURGE|REPURGE)$") {
                         if (client.ip ~ purge) {
                                 if (req.request == "REPURGE") {
                                         purge_url(req.url);
                                         error 200 "Repurged.";
                                 } else {
                                         lookup;
                                 }
                         } else {
                                 error 405 "Not allowed.";
                         }
                 } else {
                         pipe;
                 }
         } else {
                 error 403 "Access denied. Contact cacheadmin at foo.no if you
 have problems.";
         }
 }

 sub vcl_miss {
         if (req.request ~ "^(PURGE|REPURGE)$") {
                 error 404 "Not in cache.";
         } else {
                 fetch;
         }
 }
 sub vcl_hit {
         if (req.request == "PURGE") {
                 set obj.ttl = 0s;
                 error 200 "Purged.";
         } else {
                 deliver;
         }
 }
 sub vcl_fetch {
         if (obj.status == 404 || obj.status == 503 || obj.status == 500) {
                 pass;
         }

         if (!obj.valid) {
                 error;
         }
         if (!obj.cacheable) {
                 pass;
         }

         if (obj.http.Cookie) {
                 remove obj.http.Cookie;
         }
         if (obj.http.Set-Cookie) {
                 remove obj.http.Set-Cookie;
         }
         insert;
 }
 sub vcl_hash {
         set req.hash += req.url;
         if (req.http.host ~ "^bars.*.foo.no$") {
                 set req.hash += "bars.foo.no";
         } else {
                 set req.hash += req.http.host;
         }
         hash;
 }
 }}}

 Backtrace:

 {{{
 (gdb) bt
 #0  0x000000000041b8b8 in ses_sum_acct (sum=0xb42170, inc=0x470)
     at cache_session.c:215
 #1  0x000000000041b992 in SES_Charge (sp=0xb42008) at cache_session.c:230
 #2  0x000000000040ea15 in cnt_done (sp=0xb42008) at cache_center.c:219
 #3  0x0000000000410ccd in CNT_Session (sp=0xb42008) at steps.h:44
 #4  0x00000000004192b8 in wrk_do_one (w=0x7ffff9dcfad0) at
 cache_pool.c:193
 #5  0x0000000000419793 in wrk_thread (priv=0x86d320) at cache_pool.c:246
 #6  0x000000080099355b in pthread_create () from /usr/lib/libthr.so.2
 #7  0x00007ffff9bd0000 in ?? ()
 Cannot access memory at address 0x7ffff9dd0000
 (gdb) frame 0
 #0  0x000000000041b8b8 in ses_sum_acct (sum=0xb42170, inc=0x470)
     at cache_session.c:215
 215             sum->sess += inc->sess;
 (gdb) print sp
 No symbol "sp" in current context.
 (gdb) frame 1
 #1  0x000000000041b992 in SES_Charge (sp=0xb42008) at cache_session.c:230
 230             ses_sum_acct(&sp->acct, a);
 (gdb) print sp
 $1 = (struct sess *) 0xb42008
 (gdb) print *sp
 $2 = {magic = 741317722, fd = 0, id = 0, xid = 0, restarts = 0, wrk = 0x0,
   sockaddrlen = 16, mysockaddrlen = 128, sockaddr = 0xb42670,
   mysockaddr = 0xb426f0, addr = 0x0, port = 0x0, srcaddr = 0x0, doclose =
 0x0,
   http = 0x0, http0 = 0x0, ws = {{magic = 0, id = 0x0, s = 0x0, f = 0x0,
       r = 0x0, e = 0x0}}, ws_ses = 0x0, ws_req = 0x0, htc = {{magic = 0,
       fd = 0, ws = 0x0, rxbuf = {b = 0x0, e = 0x0}, pipeline = {b = 0x0,
         e = 0x0}}}, t_open = nan(0x8000000000000),
   t_req = nan(0x8000000000000), t_resp = nan(0x8000000000000),
   t_end = nan(0x8000000000000), step = STP_AGAIN, cur_method = 0,
   handling = 0, wantbody = 0 '\0', err_code = 0, err_reason = 0x0, list =
 {
     vtqe_next = 0x0, vtqe_prev = 0x0}, backend = 0x0, bereq = 0x0, obj =
 0x0,
   vcl = 0x0, mem = 0xb42000, workreq = {list = {vtqe_next = 0x0,
       vtqe_prev = 0x0}, sess = 0x0}, acct = {first = 0, sess = 0, req = 0,
     pipe = 0, pass = 0, fetch = 0, hdrbytes = 0, bodybytes = 0}, nhashptr
 = 0,
   ihashptr = 0, lhashptr = 0, hashptr = 0x0}
 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/196>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list