1. 22 Nov, 2019 4 commits
  2. 20 Nov, 2019 1 commit
  3. 19 Nov, 2019 2 commits
    • Dridi Boukelmoune's avatar
      Put some serious red tape on VCL_STRANDS · 11d55148
      Dridi Boukelmoune authored
      I started suspecting that we need this clarification during the review
      of #3123 [1] and was able to verify it with a simple test case. First I
      needed a function I put in vmod_debug:
      
          $Function STRANDS hoard_strands(PRIV_TASK, STRANDS s)
      
          Return the first value of s for the rest of the task.
      
      The implementation is very straightforward:
      
          struct hoarder {
                 VCL_STRANDS     s;
          };
      
          VCL_STRANDS
          xyzzy_hoard_strands(VRT_CTX, struct vmod_priv *priv, VCL_STRANDS s)
          {
                 struct hoarder *h;
      
                 CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
                 AN(priv);
      
                 if (priv->priv == NULL) {
                         h = malloc(sizeof *h);
                         AN(h);
                         h->s = s;
                         priv->priv = h;
                         priv->free = free;
                 }
      
                 return (priv->priv);
          }
      
      And then the following test case results in a panic on my system, but I
      suspect this is generally undefined behavior and other nasty results may
      occur under different circumstances:
      
          varnishtest "Beware of STRANDS"
      
          varnish v1 -vcl {
                  import debug;
                  backend be none;
                  sub vcl_recv {
                          debug.hoard_strands("recv: " + req.url);
                  }
                  sub vcl_miss {
                          debug.hoard_strands("miss: " + req.url);
                          return (synth(200));
                  }
                  sub vcl_synth {
                          set resp.body = debug.hoard_strands("synth: " + req.url);
                          return (deliver);
                  }
          } -start
      
          client c1 {
                  txreq
                  rxresp
                  expect resp.body ~ recv
          } -run
      
      This also begs the following question: can it ever be safe to let a VMOD
      function return a STRANDS? Maybe it should be banned from return types.
      
      [1] https://github.com/varnishcache/varnish-cache/pull/3123#discussion_r345617108
      11d55148
    • Dridi Boukelmoune's avatar
      Why-does-slink-hate-capitalization OCD · 34261afd
      Dridi Boukelmoune authored
      Is it because German capitalizes so many words that his shift keys have
      become hit or miss?
      34261afd
  4. 18 Nov, 2019 10 commits
  5. 17 Nov, 2019 1 commit
  6. 16 Nov, 2019 3 commits
  7. 15 Nov, 2019 2 commits
    • Dridi Boukelmoune's avatar
      Make sure to use none backends in generated C code · 3ff76286
      Dridi Boukelmoune authored
      Otherwise you might run into this:
      
          Message from VCC-compiler:
          Unused backend nil, defined:
          ('<vcl.inline>' Line 4 Pos 17)
                  backend nil none;
          ----------------###------
      
          (That was just a warning)
          Message from C-compiler:
          vgc.c:1476:20: error: unused variable 'vgc_backend_nil' [-Werror,-Wunused-variable]
          static VCL_BACKEND vgc_backend_nil;
                             ^
          1 error generated.
          Running C-compiler failed, exited with 1
          VCL compilation failed
      
      This is done in both init and discard code to maintain the balance.
      3ff76286
    • Dridi Boukelmoune's avatar
      Revert "Correct WS allocation in tlv_string" · b9eaa943
      Dridi Boukelmoune authored
      This reverts commit 1d23a733.
      b9eaa943
  8. 14 Nov, 2019 4 commits
    • Emmanuel Hocdet's avatar
      Correct WS allocation in tlv_string · 1d23a733
      Emmanuel Hocdet authored
      Fixes #3131
      1d23a733
    • Dridi Boukelmoune's avatar
      GC stale check · 85fca27b
      Dridi Boukelmoune authored
      85fca27b
    • Dridi Boukelmoune's avatar
      We can't have fun outside the ISO C99 standard · 2215057d
      Dridi Boukelmoune authored
      Because someone brought a suncc to a vtest party.
      2215057d
    • Dridi Boukelmoune's avatar
      Big bang rewrite of m00049.vtc · 175af0b9
      Dridi Boukelmoune authored
      Now that vtc.typesize() is a bit more reliable, it's easier to deal with
      architecture differences for the sizeof struct vrt_blob. For a much more
      reliable failure check, it now looks at logs.
      
      There may also have been a time when depending on the error we trigger
      we could fail with a 500 or a 503, this is no longer the case.
      
      For the nitty-gritty of the new test case, there are some comments to
      hopefully help (at least my future self) decipher this beast.
      
      This new test case remains stable even with the changes from #3123.
      175af0b9
  9. 13 Nov, 2019 13 commits