Actions
Bug #908
closedInvalid free in list_ust_events
Start date:
08/24/2015
Due date:
% Done:
100%
Estimated time:
Description
If lttng_list_tracepoints fails (can't connect to a sessiond for example, I suppose), events_list is freed while not set. Here is the corresponding valgrind trace.
==5531== Memcheck, a memory error detector ==5531== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==5531== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info ==5531== Command: lttng list -u ==5531== Error: Unable to list UST events: No session daemon is available ==5531== Conditional jump or move depends on uninitialised value(s) ==5531== at 0x4C2A611: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5531== by 0x40BE43: list_ust_events (list.c:548) ==5531== by 0x40BE43: cmd_list (list.c:1702) ==5531== by 0x408F03: handle_command (lttng.c:295) ==5531== by 0x408F03: parse_args (lttng.c:414) ==5531== by 0x408F03: main (lttng.c:464) ==5531== ==5531== Invalid free() / delete / delete[] / realloc() ==5531== at 0x4C2A65B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5531== by 0x40BE43: list_ust_events (list.c:548) ==5531== by 0x40BE43: cmd_list (list.c:1702) ==5531== by 0x408F03: handle_command (lttng.c:295) ==5531== by 0x408F03: parse_args (lttng.c:414) ==5531== by 0x408F03: main (lttng.c:464) ==5531== Address 0x401458 is not stack'd, malloc'd or (recently) free'd ==5531== Error: Command error ==5531== ==5531== HEAP SUMMARY: ==5531== in use at exit: 0 bytes in 0 blocks ==5531== total heap usage: 45 allocs, 46 frees, 6,885 bytes allocated ==5531== ==5531== All heap blocks were freed -- no leaks are possible ==5531== ==5531== For counts of detected and suppressed errors, rerun with: -v ==5531== Use --track-origins=yes to see where uninitialised values come from ==5531== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Actions