Skip to content

There seems to be a memory leak in systemd-journald #11253

@evverx

Description

@evverx

It was originally discovered in #11252 (where I'm trying to use Ubuntu Xenial on Travis CI to run systemd under ASan to start catching issues like #11251):


562/726 fuzz-journald-native-fd:basic:address   FAIL     0.07 s (exit status 1)

--- command ---
/usr/bin/env /build/build/fuzz-journald-native-fd:address /build/test/fuzz/fuzz-journald-native-fd/basic
--- stdout ---
/build/test/fuzz/fuzz-journald-native-fd/basic... 
--- stderr ---
Found container virtualization none.

=================================================================
==27402==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 4 object(s) allocated from:
    #0 0x7fd9eb8637e0 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a7e0)
    #1 0x7fd9eb3300bd in cg_pid_get_path ../../../../src/basic/cgroup-util.c:1064
    #2 0x7fd9eb3320ae in cg_pid_get_path_shifted ../../../../src/basic/cgroup-util.c:1411
    #3 0x560b24bba27a in client_context_read_cgroup ../../../../src/journal/journald-context.c:255
    #4 0x560b24bbceca in client_context_really_refresh ../../../../src/journal/journald-context.c:495
    #5 0x560b24bbe0b4 in client_context_get_internal ../../../../src/journal/journald-context.c:651
    #6 0x560b24bbe1a5 in client_context_get ../../../../src/journal/journald-context.c:665
    #7 0x560b24b87c1d in server_process_native_message ../../../../src/journal/journald-native.c:293
    #8 0x560b24b8888e in server_process_native_file ../../../../src/journal/journald-native.c:383
    #9 0x560b24b848ed in LLVMFuzzerTestOneInput ../../../../src/fuzz/fuzz-journald-native-fd.c:36
    #10 0x560b24b8554e in main ../../../../src/fuzz/fuzz-main.c:39
    #11 0x7fd9eacda09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)

SUMMARY: AddressSanitizer: 8 byte(s) leaked in 4 allocation(s).
-------

Given that I can't reproduce it on a "normal" xenial machine it looks like it has something to do with the cgroup layout being used there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingjournal

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions