https://bugs.lttng.org/https://bugs.lttng.org/themes/lttng/favicon/a.ico?14249722912021-05-07T20:20:23ZLTTng bugs repositoryLTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38852021-05-07T20:20:23ZFrancis Deslauriersfrancis.deslauriers@efficios.com
<ul><li><strong>Assignee</strong> set to <i>Francis Deslauriers</i></li></ul> LTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38862021-05-11T03:09:57ZPhilippe Proulxeeppeliteloop@gmail.com
<ul></ul><p>Here's something more. Might be related, but maybe not.</p>
<p>I start a session daemon as such:</p>
<pre>
# lttng-sessiond -v --group=eepp
</pre>
<p>Then I add a trigger which fires a lot:</p>
<pre>
$ lttng --group=eepp add-trigger --condition=event-rule-matches \
--domain=kernel --type=syscall --action=notify
</pre>
<p>Now, when I kill <code>lttng-sessiond</code>, it doesn't unload any kernel module and exits with status 134.</p>
<p>It doesn't seem to behave like that without <code>-v</code>, and with triggers which don't fire a lot.</p>
<p>Sometimes, when I kill <code>lttng-sessiond</code> in these conditions, the system freezes.</p>
<p>Using LTTng-tools <code>e80b715053eb21fe9139241be786afc2688c6795</code> and LTTng-modules <code>4667f7f663bcf3e8ec315fc7965893aeabd64e95</code> now.</p> LTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38882021-05-11T15:06:39ZFrancis Deslauriersfrancis.deslauriers@efficios.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li></ul><p>In what you described above, how much time passed between the <code>add-trigger</code> and the <code>kill</code> commands ?</p>
<p>Please try the latest commit of the LTTng-Tools master branch. The following commit is fixing a leak:<br />commit f568738c649cb005c7d838166c864addbcc27571<br />Author: Francis Deslauriers <<a class="email" href="mailto:francis.deslauriers@efficios.com">francis.deslauriers@efficios.com</a>><br />Date: Fri May 7 17:44:52 2021 -0400</p>
<pre><code>Fix: action-executor: leak of `work_item::subitems` field</code></pre>
<p>This leak can explain all 3 issues you see: the system crash, the unloading of modules, and the sessiond exit status.</p> LTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38902021-05-11T20:07:39ZJérémie Galarneaujeremie.galarneau@efficios.com
<ul></ul><p>Francis Deslauriers wrote in <a href="#note-3">#note-3</a>:</p>
<blockquote>
<p>This leak can explain all 3 issues you see: the system crash, the unloading of modules, and the sessiond exit status.</p>
</blockquote>
<p>I'm not sure I see how a user space leak can lead to a kernel panic. Am I missing something?</p> LTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38912021-05-12T01:22:55ZFrancis Deslauriersfrancis.deslauriers@efficios.com
<ul></ul><p>Jérémie Galarneau wrote in <a href="#note-4">#note-4</a>:</p>
<blockquote>
<p>I'm not sure I see how a user space leak can lead to a kernel panic. Am I missing something?</p>
</blockquote>
<p>Last Friday, it was discussed on IRC that this commit (that Phil didn't have when he reported the issue) might fix the source of kernel panic:<br /><pre>
commit 6c8c025bf7552b6073c5c1884e1493badd842f42
Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Date: Thu May 6 11:48:42 2021 -0400
Introduce struct lttng_kernel_tracepoint_class, enum probe_desc field
</pre></p>
<p>I agree that the leak doesn't explain the kernel panic. I assumed that Phil didn't witnessed a kernel panic that second time around but I might have assumed too much.</p>
<p>What I should have said "system freeze" instead of "system crash" in my last comment.</p> LTTng - Bug #1315: Kernel panics after `pkill lttng`; root session daemon has active triggershttps://bugs.lttng.org/issues/1315?journal_id=38922021-05-12T13:21:00ZMathieu Desnoyersmathieu.desnoyers@efficios.com
<ul></ul><p>For the sake of discussion, here are the leaks which were fixed by commit 6c8c025bf7552b6073c5c1884e1493badd842f42 (AFAIK):</p>
<p>lttng_kprobes_register_event() label register_error leaked:<br /> - event_recorder->priv->parent.desc->fields<sup><a href="#fn0">0</a></sup></p>
<p>lttng_uprobes_register_event() label register_error leaked:<br /> - event_recorder->priv->parent.desc->fields<sup><a href="#fn0">0</a></sup><br /> - event_recorder->priv->parent.desc->fields</p>