Commit 92f3d075 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Try adding a memory barrier on the varnishd side, and use the JSON offset

as canary on the API side.
parent 57a3042d
......@@ -39,6 +39,7 @@
#include "vend.h"
#include "vgz.h"
#include "vmb.h"
#include "vapi/vsc_int.h"
/*--------------------------------------------------------------------*/
......@@ -79,7 +80,6 @@ VSC_Alloc(const char *nm, size_t sd,
AN(p);
memset(p, 0, sd);
vbe64enc(p, sd);
memset(&vz, 0, sizeof vz);
assert(Z_OK == inflateInit2(&vz, 31));
......@@ -94,6 +94,8 @@ VSC_Alloc(const char *nm, size_t sd,
vsg->seg = p;
vsg->ptr = p + 8;
VTAILQ_INSERT_TAIL(&vsc_seglist, vsg, list);
VWMB();
vbe64enc(p, sd);
return (p + 8);
}
......
......@@ -37,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "vdef.h"
#include "vas.h"
......@@ -300,6 +301,11 @@ vsc_build_vf_list(struct vsm *vd)
continue;
AZ(VSM_Map(vd, &vsc->iter_fantom));
u = vbe64dec(vsc->iter_fantom.b);
if (u == 0) {
VRMB();
usleep(100000);
u = vbe64dec(vsc->iter_fantom.b);
}
assert(u > 0);
p = (char*)vsc->iter_fantom.b + 8 + u;
vj = vjsn_parse(p, &e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment