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>
(cherry picked from commit
6ed8d839b421442a64410444ca8f88f157ae28b3)