]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
crimson/osd: add embedded suppression ruleset for LSan
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 15 Mar 2023 09:40:15 +0000 (09:40 +0000)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 20 Mar 2023 14:53:15 +0000 (15:53 +0100)
commit6ed8d839b421442a64410444ca8f88f157ae28b3
treef55cd471ff32f6c770b4ddfbdd069d54cff2c923
parent8a291f4cc74ff6586b414b6772b04e8cb75742fb
crimson/osd: add embedded suppression ruleset for LSan

This commit, basing the idea from the Chromium browser,
embdeds the suppression rules directly into the crimson
executable. The benefit is simplicity and no need to modify
the teuthology code to ship a file across all involved nodes
like already happens for `valgrind.supp`.

From `teuthology/task/install/util.py`:

```
def _ship_utilities(ctx):
    """
    Write a copy of valgrind.supp to each of the remote sites.  Set executables
    used by Ceph in /usr/local/bin.  When finished (upon exit of the teuthology
    run), remove these files.

    :param ctx: Context
    """
    testdir = teuthology.get_testdir(ctx)
    filenames = []

    log.info('Shipping valgrind.supp...')
    assert 'suite_path' in ctx.config
    try:
        with open(
            os.path.join(ctx.config['suite_path'], 'valgrind.supp'),
            'rb'
                ) as f:
            fn = os.path.join(testdir, 'valgrind.supp')
            filenames.append(fn)
            for rem in ctx.cluster.remotes.keys():
                teuthology.sudo_write_file(
                    remote=rem,
                    path=fn,
                    data=f,
                    )
                f.seek(0)
    except IOError as e:
        log.info('Cannot ship supression file for valgrind: %s...', e.strerror)
```

With these suppressions `--mkfs` with crimson, BlueStore and tcmalloc
starts returning the proper exit code:

```
[rzarzynski@o06 build]$ /home/rzarzynski/ceph1/build/bin/crimson-osd -i 0 -c /home/rzarzynski/ceph1/build/ceph.conf --mkfs --key AQCZsRBkM5CPIBAACmCbEiP3DPh+x9iiaRDZmA== --osd-uuid c3d4aea0-02de-459b-ad00-fe943906a9a8 --cpuset 0-0
...
created object store /home/rzarzynski/ceph1/build/dev/osd0 for osd.0 fsid 8c9aa852-1ba2-4800-9695-e0be4bf877dc
-----------------------------------------------------
Suppressions used:
  count      bytes template
      1          8 InitModule
-----------------------------------------------------
[rzarzynski@o06 build]$ echo $?
0
```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/CMakeLists.txt
src/crimson/osd/lsan_suppressions.cc [new file with mode: 0644]