Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRT_priv_task fails in vcl_pipe #2820

Closed
nigoroll opened this issue Nov 5, 2018 · 0 comments

Comments

Projects
None yet
4 participants
@nigoroll
Copy link
Contributor

commented Nov 5, 2018

originally logged by @jpastuszek in nigoroll/varnish-modules#6

I am using HEAD of 6.1 branch.

Calling var.get("foo") in sub vcl_pipe causes Varnish to crash. This is working fine with Varnish v5.2.1.

Panic at: Fri, 02 Nov 2018 16:43:21 GMT
Assert error in VRT_priv_task(), cache/cache_vrt_priv.c line 128:
  Condition(ctx->req == NULL || ctx->bo == NULL) not true.
version = varnish-6.1.1 revision efc2f6c1536cf2272e471f5cff5f145239b19460, vrt api = 8.0
ident = Linux,4.9.70-25.242.amzn1.x86_64,x86_64,-junix,-smalloc,-smalloc,-hcritbit,epoll
now = 21529.331444 (mono), 1541177000.068993 (real)
Backtrace:
  0x43a4db: /usr/sbin/varnishd() [0x43a4db]
  0x499402: /usr/sbin/varnishd(VAS_Fail+0x42) [0x499402]
  0x450ace: /usr/sbin/varnishd(VRT_priv_task+0x18e) [0x450ace]
  0x7fcda29fb9d5: vcl_boot.1541176998.022601128/vgc.so(VGC_function_vcl_pipe+0x15) [0x7fcda29fb9d5]
  0x44b31a: /usr/sbin/varnishd() [0x44b31a]
  0x44d81a: /usr/sbin/varnishd(VCL_pipe_method+0x5a) [0x44d81a]
  0x43f894: /usr/sbin/varnishd(CNT_Request+0x1354) [0x43f894]
  0x461aa7: /usr/sbin/varnishd() [0x461aa7]
  0x457fee: /usr/sbin/varnishd() [0x457fee]
  0x458440: /usr/sbin/varnishd() [0x458440]
thread = (cache-worker)
thr.req = 0x7fcda360d020 {
  vxid = 2, transport = HTTP/1 {
    state = HTTP1::Proc
  }
  step = R_STP_PIPE,
  req_body = R_BODY_NONE,
  restarts = 0, esi_level = 0,
  sp = 0x7fcda2420420 {
    fd = 25, vxid = 1,
    t_open = 1541177000.068901,
    t_idle = 1541177000.068901,
    ws = 0x7fcda2420460 {
      id = \"ses\",
      {s, f, r, e} = {0x7fcda2420498, +96, (nil), +352},
    },
    transport = HTTP/1 {
      state = HTTP1::Proc
    }
    client = 127.0.0.1 58198 :2080,
  },
  worker = 0x7fcda3b47da0 {
    ws = 0x7fcda3b47e48 {
      id = \"wrk\",
      {s, f, r, e} = {0x7fcda3b47120, +0, (nil), +2040},
    },
    VCL::method = inside PIPE,
    VCL::return = 0x0,
    VCL::methods = {RECV, PIPE, HASH},
  },
  ws = 0x7fcda360d170 {
    id = \"req\",
    {s, f, r, e} = {0x7fcda36160a8, +112, (nil), +61264},
  },
  http_conn = 0x7fcda3616048 {
    fd = 25 (@0x7fcda2420444),
    doclose = NULL,
    ws = 0x7fcda360d170 {
      [Already dumped, see above]
    },
    {rxbuf_b, rxbuf_e} = {0x7fcda36160a8, 0x7fcda36160f6},
    {pipeline_b, pipeline_e} = {(nil), (nil)},
    content_length = -1,
    body_status = none,
    first_byte_timeout = 0.000000,
    between_bytes_timeout = 0.000000,
  },
  http[req] = 0x7fcda360d210 {
    ws = 0x7fcda360d170 {
      [Already dumped, see above]
    },
    hdrs {
      \"GET\",
      \"/\",
      \"HTTP/1.1\",
      \"Host: localhost:2080\",
      \"User-Agent: curl/7.53.1\",
      \"Accept: */*\",
      \"X-Forwarded-For: 127.0.0.1\",
    },
  },
  vcl = {
    name = \"boot\",
    busy = 2,
    discard = 0,
    state = auto,
    temp = warm,
    conf = {
      srcname = {
        \"/etc/varnish/default.vcl\",
        \"Builtin\",
      },
    },
  },
  vmods = {
    var = {Varnish 6.1.1 efc2f6c1536cf2272e471f5cff5f145239b19460, 8.0},
  },
  flags = {
  },
  privs = 0x7fcda360d1f8 {
  },
},
thr.busyobj = 0x7fcdaa667020 {
  ws = 0x7fcdaa667060 {
    id = \"bo\",
    {s, f, r, e} = {0x7fcdaa66ff60, +40, (nil), +61592},
  },
  retries = 0, flags = {do_stream},
  vfc = 0x7fcdaa66ff18 {
    failed = 0,
    req = (nil),
    resp = (nil),
    wrk = (nil),
    oc = (nil),
    obj_flags = 0x0,
  },
  director_req = 0x7fcdaa4125a0 {
    cli_name = boot.default,
    health = healthy,
    admin_health = probe, changed = 1541176998.232625,
    type = backend {
      ipv4 = 10.1.1.22,
      port = 6767,
      hosthdr = 10.1.1.22,
      n_conn = 0,
    },
  },
  http[bereq] = 0x7fcdaa667628 {
    ws = 0x7fcdaa667060 {
      [Already dumped, see above]
    },
    hdrs {
      \"GET\",
      \"/\",
      \"HTTP/1.1\",
      \"Host: localhost:2080\",
      \"User-Agent: curl/7.53.1\",
      \"Accept: */*\",
      \"X-Forwarded-For: 127.0.0.1\",
      \"X-Varnish: 2\",
      \"Connection: close\",
    },
  },
  vcl = {
    name = \"boot\",
    busy = 2,
    discard = 0,
    state = auto,
    temp = warm,
    conf = {
      srcname = {
        \"/etc/varnish/default.vcl\",
        \"Builtin\",
      },
    },
  },
  vmods = {
    var = {Varnish 6.1.1 efc2f6c1536cf2272e471f5cff5f145239b19460, 8.0},
  },
},

Minimum configuration:

vcl 4.0;
import var;

backend default {
        .host = "10.1.1.22";
        .port = "6767";
}

#### Default returns - do not execute varnish defaults
sub vcl_init {
        return (ok);
}

sub vcl_recv {
        return (pipe);
}

sub vcl_hash {
        return (lookup);
}

sub vcl_hit {
        return (deliver);
}

sub vcl_miss {
        return (fetch);
}

sub vcl_pass {
        return (fetch);
}

sub vcl_synth {
        return (deliver);
}

sub vcl_backend_fetch {
        return (fetch);
}

sub vcl_backend_response {
        return (deliver);
}

sub vcl_deliver {
        return (deliver);
}

sub vcl_pipe {
        var.get("foo");
        return (pipe);
}

sub vcl_backend_error {
        return (deliver);
}

sub vcl_fini {
        return (ok);
}

@nigoroll nigoroll self-assigned this Nov 5, 2018

@nigoroll nigoroll closed this in 7a13ff5 Nov 5, 2018

@bsdphk bsdphk added the a=bugwash label Nov 5, 2018

hermunn added a commit to hermunn/varnish-cache that referenced this issue Nov 5, 2018

hermunn added a commit to hermunn/varnish-cache that referenced this issue Nov 5, 2018

@nigoroll nigoroll added b=bug c=varnishd and removed a=bugwash labels Nov 6, 2018

hermunn added a commit to hermunn/varnish-cache that referenced this issue Nov 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.