Do not dereference cached pointers in the PRIV_TASK fini method

The main discussion of this topic is going to happen in #3600, but
whatever the outcome, the fini method does not happen within the task,
so we must not dereference any cached pointers (unless we own them).

Closes #3606
parent dd9d7927
......@@ -121,8 +121,8 @@ logexpect l0 -v v1 -g raw -d 1 -m -q "vxid == 0" {
expect 0 = Debug {^objb.priv_task.. = .*"initY"}
expect 0 = VCL_Log {^objb initY}
expect ? = Debug {^priv_task_fini}
expect ? = Debug {^obj_priv_task_fini.*"initX"}
expect ? = Debug {^obj_priv_task_fini.*"initY"}
expect ? = Debug {^obj_priv_task_fini}
expect ? = Debug {^obj_priv_task_fini}
expect 0 = Debug {^vcl1: VCL_EVENT_WARM}
# need an anchor for the ? expects to begin
......@@ -174,7 +174,7 @@ logexpect l1001 -v v1 -g vxid -q "vxid == 1001" {
expect 0 = VCL_return {^deliver}
expect 9 = Timestamp {^Resp}
expect ? = Debug {^priv_task_fini}
expect ? = Debug {^obj_priv_task_fini.*"d1001"}
expect ? = Debug {^obj_priv_task_fini}
} -start
logexpect l1002 -v v1 -g vxid -q "vxid == 1002" {
......@@ -203,7 +203,7 @@ logexpect l1002 -v v1 -g vxid -q "vxid == 1002" {
expect 0 = VCL_return {^deliver}
expect 9 = Timestamp {^BerespBody}
expect ? = Debug {^priv_task_fini}
expect ? = Debug {^obj_priv_task_fini.*"r1002"}
expect ? = Debug {^obj_priv_task_fini}
} -start
logexpect l1006 -v v1 -g vxid -q "vxid == 1006" {
......@@ -237,7 +237,7 @@ logexpect l1006 -v v1 -g vxid -q "vxid == 1006" {
expect 0 = VCL_return {^pipe}
expect 4 = PipeAcct
expect ? = Debug {^priv_task_fini}
expect ? = Debug {^obj_priv_task_fini.*"p1006"}
expect ? = Debug {^obj_priv_task_fini}
} -start
client c1 {
......
......@@ -157,11 +157,11 @@ xyzzy_obj_test_priv_vcl(VRT_CTX,
static void v_matchproto_(vmod_priv_fini_f) \
obj_priv_ ## name ## _fini(VRT_CTX, void *ptr) \
{ \
const char * const fmt = "obj_priv_" #name "_fini(%p = \"%s\")"; \
const char * const fmt = "obj_priv_" #name "_fini(%p)"; \
\
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \
AN(ptr); \
mylog(ctx->vsl, SLT_Debug, fmt, ptr, (char *)ptr); \
mylog(ctx->vsl, SLT_Debug, fmt, ptr); \
} \
\
static const struct vmod_priv_methods \
......
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