X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-context-vpid.c;h=3f16e03a6d996992107cbfe6eac19bb2e52dbf76;hb=9b4a21cced19f3c661fdf5e08d40688ff2539ad7;hp=f12eb97efebe25bbae9355320a3d9e5a16da0577;hpb=44252f0fd51fd4bf28926dcef525355bceb08c5f;p=lttng-modules.git diff --git a/lttng-context-vpid.c b/lttng-context-vpid.c index f12eb97e..3f16e03a 100644 --- a/lttng-context-vpid.c +++ b/lttng-context-vpid.c @@ -32,7 +32,13 @@ void vpid_record(struct lttng_ctx_field *field, { pid_t vpid; - vpid = task_tgid_vnr(current); + /* + * nsproxy can be NULL when scheduled out of exit. + */ + if (!current->nsproxy) + vpid = 0; + else + vpid = task_tgid_vnr(current); lib_ring_buffer_align_ctx(ctx, ltt_alignof(vpid)); chan->ops->event_write(ctx, &vpid, sizeof(vpid)); }