{"action":"closed","issue":{"url":"https://api.github.com/repos/lkarsten/testrepo/issues/213","labels_url":"https://api.github.com/repos/lkarsten/testrepo/issues/213/labels{/name}","comments_url":"https://api.github.com/repos/lkarsten/testrepo/issues/213/comments","events_url":"https://api.github.com/repos/lkarsten/testrepo/issues/213/events","html_url":"https://github.com/lkarsten/testrepo/issues/213","id":120423017,"number":213,"title":"[trac #213] Varnish crashes on SES_Delete(), cache_session.c line 340","user":{"login":"lkarsten","id":108894,"avatar_url":"https://avatars.githubusercontent.com/u/108894?v=3","gravatar_id":"","url":"https://api.github.com/users/lkarsten","html_url":"https://github.com/lkarsten","followers_url":"https://api.github.com/users/lkarsten/followers","following_url":"https://api.github.com/users/lkarsten/following{/other_user}","gists_url":"https://api.github.com/users/lkarsten/gists{/gist_id}","starred_url":"https://api.github.com/users/lkarsten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lkarsten/subscriptions","organizations_url":"https://api.github.com/users/lkarsten/orgs","repos_url":"https://api.github.com/users/lkarsten/repos","events_url":"https://api.github.com/users/lkarsten/events{/privacy}","received_events_url":"https://api.github.com/users/lkarsten/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-04T15:24:15Z","updated_at":"2015-12-04T15:24:17Z","closed_at":"2015-12-04T15:24:17Z","body":"ISSUE 213 IMPORTED FROM TRAC FOR INDEXING.\nI am running Varnish trunk/2518, in FreeBSD/amd64 7.0-RC1. Now and then Varnish crashes:\n\n1) \n\n```\nFeb 21 19:01:19 kartcache1 varnishd: Child (609) said <<Assert error\nin SES_Delete(), cache_session.c line 340:>>\nFeb 21 19:01:19 kartcache1 varnishd: Child (609) said <<Condition((sp->vcl) == 0) not true.>>\nFeb 21 19:01:19 kartcache1 varnishd: Child (609) said <<  errno = 32\n(Broken pipe)>>\n```\n\nBacktrace:\n\n```\n(gdb) bt\n#0  0x0000000800d17fec in thr_kill () from /lib/libc.so.7\n#1  0x0000000800da1c5b in abort () from /lib/libc.so.7\n#2  0x0000000800674f92 in lbv_assert (func=Could not find the frame base for \"lbv_assert\".\n) at assert.c:65\n#3  0x000000000041cd84 in SES_Delete (sp=0x2da2a9d008) at cache_session.c:340\n#4  0x0000000000419eb2 in WRK_QueueSession (sp=0x2da2a9d008)\n    at cache_pool.c:319\n#5  0x000000000041382e in hsh_rush (oh=0x2db1185c90) at cache_hash.c:288\n#6  0x0000000000413a88 in HSH_Unbusy (o=0xc98057000) at cache_hash.c:310\n#7  0x000000000040cc23 in cnt_fetch (sp=0x2d9bbb0008) at cache_center.c:376\n#8  0x000000000040e611 in CNT_Session (sp=0x2d9bbb0008) at steps.h:41\n#9  0x0000000000418edd in wrk_do_one (w=0x7fff82012ae0) at cache_pool.c:194\n#10 0x00000000004196ea in wrk_thread (priv=0x800f130c0) at cache_pool.c:248\n#11 0x0000000800a9fa38 in pthread_getprio () from /lib/libthr.so.3\n#12 0x00007fff81e13000 in ?? ()\nCannot access memory at address 0x7fff82013000\n(gdb) frame 3\n#3  0x000000000041cd84 in SES_Delete (sp=0x2da2a9d008) at cache_session.c:340\n340\t\tAZ(sp->vcl);\n(gdb) print *sp\n$1 = {magic = 741317722, fd = -1, id = 2981, xid = 1254738649, restarts = 0, \n  esis = 0, wrk = 0x7ffff81c1ae0, sockaddrlen = 16, mysockaddrlen = 128, \n  sockaddr = 0x2da2a9d688, mysockaddr = 0x2da2a9d708, \n  addr = 0x2da2a9d788 \"81.167.12.230\", port = 0x2da2a9d796 \"14398\", \n  srcaddr = 0x2d95c3b7f0, doclose = 0x0, http = 0x2da2a9d1e0, \n  http0 = 0x2da2a9d428, ws = {{magic = 905626964, id = 0x438c00 \"sess\", \n      s = 0x2da2a9d788 \"81.167.12.230\", f = 0x2da2a9dafb \" GMT\", r = 0x0, \n      e = 0x2da2a9f788 \"\"}}, ws_ses = 0x2da2a9d79c \"GET\", \n  ws_req = 0x2da2a9da93 \"\", htc = {{magic = 1041886673, fd = 2981, \n      ws = 0x2da2a9d070, rxbuf = {b = 0x2da2a9d79c \"GET\", \n        e = 0x2da2a9da93 \"\"}, pipeline = {b = 0x0, e = 0x0```, \n  t_open = 1203620390.6953387, t_req = 1203620428.5261879, \n  t_resp = nan(0x8000000000000), t_end = 1203620477.8366699, grace = 300, \n  step = STP_LOOKUP, cur_method = 0, handling = 4, sendbody = 0 '\\0', \n  wantbody = 1 '\\001', err_code = 0, err_reason = 0x0, list = {\n    vtqe_next = 0x0, vtqe_prev = 0x2db1185cc8}, director = 0x800f2b288, \n  backend = 0x0, bereq = 0x0, obj = 0x0, objhead = 0x2db1185c90, \n  vcl = 0x2d89c03fa0, mem = 0x2da2a9d000, workreq = {list = {\n      vtqe_next = 0x2daa501170, vtqe_prev = 0x540df0}, sess = 0x2da2a9d008}, \n  acct = {first = 1203620390.6953387, sess = 1, req = 1, pipe = 0, pass = 0, \n    fetch = 0, hdrbytes = 0, bodybytes = 0}, nhashptr = 12, ihashptr = 4, \n  lhashptr = 71, hashptr = 0x2da2a9da98}\n```\n\n2) \n\n```\nFeb 21 19:32:09 kartcache1 varnishd: Child (81816) said <<Assert error in SES_De\nlete(), cache_session.c line 340:>>\nFeb 21 19:32:09 kartcache1 varnishd: Child (81816) said <<Condition((sp->vcl)== 0) not true.>>\n```\n\nBacktrace:\n\n```\n(gdb) bt\n#0  0x0000000800d17fec in thr_kill () from /lib/libc.so.7\n#1  0x0000000800da1c5b in abort () from /lib/libc.so.7\n#2  0x0000000800674f92 in lbv_assert (func=Could not find the frame base for \"lbv_assert\".\n) at assert.c:65\n#3  0x000000000041df52 in VCL_Get (vcc=0x807301160) at cache_vcl.c:85\n#4  0x00000000004100b7 in exp_prefetch (arg=0x0) at cache_expire.c:207\n#5  0x0000000800a9fa38 in pthread_getprio () from /lib/libthr.so.3\n#6  0x0000000000000000 in ?? ()\nCannot access memory at address 0x7fffff9fe000\n(gdb) frame 3\n#3  0x000000000041df52 in VCL_Get (vcc=0x807301160) at cache_vcl.c:85\n85\t\tAN(vcl_active);\n```\n\nMy VCL:\n\n```\nbackend default {\n             set backend.host = \"192.168.110.1\";\n             set backend.port = \"80\";\n        }\nacl purge {\n        \"192.168.100.1\"/32;\n}\n\nsub vcl_recv {\n        set req.grace = 5m;\n        if (req.http.host ~ \"^(bars.*.foo.no|bazcache.foo.no)$\") {\n                if (req.request == \"GET\" || req.request == \"HEAD\") {\n                        lookup;\n                } elsif (req.request ~ \"^(PURGE|REPURGE)$\") {\n                        if (client.ip ~ purge) {\n                                if (req.request == \"REPURGE\") {\n                                        purge_url(req.url);\n                                        error 200 \"Repurged.\";\n                                } else {\n                                        lookup;\n                                }\n                        } else {\n                                error 405 \"Not allowed.\";\n                        }\n                } else {\n                        pipe;\n                }\n        } else {\n                error 403 \"Access denied. Contact cacheadmin@foo.no if you have problems.\";\n        }\n}\n\n\nsub vcl_miss {\n        if (req.request ~ \"^(PURGE|REPURGE)$\") {\n                error 404 \"Not in cache.\";\n        } else {\n                fetch;\n        }\n}\nsub vcl_hit {\n        if (req.request == \"PURGE\") {\n                set obj.ttl = 0s;\n                error 200 \"Purged.\";\n        } else {\n                deliver;\n        }\n}\nsub vcl_fetch {\n        set obj.grace = 5m;\n        if (obj.status == 404 || obj.status == 503 || obj.status == 500) {\n                pass;\n        }\n\n        if (!obj.valid) {\n                error;\n        }\n        if (!obj.cacheable) {\n                pass;\n        }\n\n        if (obj.http.Cookie) {\n                remove obj.http.Cookie;\n        }\n        if (obj.http.Set-Cookie) {\n                remove obj.http.Set-Cookie;\n        }\n        insert;\n}\nsub vcl_hash {\n        set req.hash += req.url;\n        if (req.http.host ~ \"^bars.*.foo.no$\") {\n                set req.hash += \"bars.foo.no\";\n        } else {\n                set req.hash += req.http.host;\n        }\n        hash;\n}\n```\n\n"}}