Cause kernel OOPS. statedump PID namespace support is newly introduced
in lttng-modules 2.1. Happens when iterating on a zombie process.
Reported-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
struct task_struct *parent;
pid_t ret = 0;
- rcu_read_lock();
- parent = rcu_dereference(p->real_parent);
- ret = task_tgid_nr_ns(parent, pid_ns);
- rcu_read_unlock();
+ if (pid_ns) {
+ rcu_read_lock();
+ parent = rcu_dereference(p->real_parent);
+ ret = task_tgid_nr_ns(parent, pid_ns);
+ rcu_read_unlock();
+ }
ret;
}))
tp_memcpy(name, p->comm, TASK_COMM_LEN)