Bug #733

list -k seems corrupted sometimes

Added by Julien Desfossez about 6 years ago. Updated about 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


When doing repeated short lived live kernel tracing sessions, the output of lttng list -k is sometimes corrupted (the loglevel value seems random) or some events are missing.

Versions :
lttng-modules : 2.4.0-rc4 309370e252e189867745fb31fe5c15c9ff494f34
lttng-tools : 2.4.0-rc5 1d6448a074accdc6cb32e2f724f9768b006a6d67

Steps to reproduce :
- Compile lttngtop
- in utils/lttngtrace, check where the "$SUDO lttng list k" is called and add an exit in the if statement below that (to have a clean exit when the problem appears)
while true; do ./utils/lttngtrace ls; done

After less than 2 minutes, you should see the error message printed in loop.

It will stay in the corrupted state until you let lttngtrace continue (removing the exit in the if statement).

A copy of the corrupted lttng list -k is attached to this bug.

No change in the list of loaded modules has been noticed.
The lttng-sessiond, consumer and relay don't restart between runs of lttngtrace.

Basically, lttngtrace creates a live session with a set of events and contexts; attach to it with a client and destroys the session.
There might be something related to the list of enabled events and/or contexts, because reproducing this with only sched_switch enabled does not seem to reproduce the problem.


weird-list-k.txt (30.7 KB) weird-list-k.txt Julien Desfossez, 02/17/2014 08:45 PM

Updated by Mathieu Desnoyers about 6 years ago

  • Status changed from New to Resolved

Fixed by:

commit 53efb85a242809ed5ed21e9ab40effa696ecbc6f
Author: Mathieu Desnoyers <>
Date:   Thu Feb 20 10:23:46 2014 -0500

    Fix: miscellaneous memory handling fixes

    Issues found with Valgrind:

    - Uninitialized memory sent through sendmsg,
    - Uninitialized realloc memory,
    - Erroneous pointer arithmetic in jul_list_events(),
    - Memory leaks in kernel_consumer_add_channel(),
    - Memory leak (snapshot_destroy missing hash table cleanup),
    - Uninitialized poll/epoll memory on realloc.

    Signed-off-by: Mathieu Desnoyers <>
    Signed-off-by: David Goulet <>

Also available in: Atom PDF