Skip to content

Commit

Permalink
DAOS-16251 misc: Debug memory access issues
Browse files Browse the repository at this point in the history
A messy hack (WIP)...

Signed-off-by: Li Wei <[email protected]>
Required-githooks: true
  • Loading branch information
liw committed Aug 22, 2024
1 parent 67ad1d0 commit ac668a8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ pipeline {
// 'stages of this run (i.e. auto, auto_md_on_ssd, auto:-3DNAND, ' +
// '0000:81:00.0, etc.). Does not apply to MD on SSD stages.')
string(name: 'BuildType',
defaultValue: '',
defaultValue: 'debug',
description: 'Type of build. Passed to scons as BUILD_TYPE. (I.e. dev, release, debug, etc.). ' +
'Defaults to release on an RC or dev otherwise.')
string(name: 'TestRepeat',
Expand Down
4 changes: 3 additions & 1 deletion site_scons/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ def define_components(reqs):

if reqs.target_type == 'debug':
abt_build.append('--enable-debug=most')
abt_build.append('--disable-mem-pool')
abt_build.append('--disable-aligned-alloc')
else:
abt_build.append('--disable-debug')

Expand All @@ -295,7 +297,7 @@ def define_components(reqs):
['make'],
['make', 'install']],
requires=['libunwind'],
libs=['abt'],
# libs=['abt'],
headers=['abt.h'])

reqs.define('fuse', libs=['fuse3'], defines=['FUSE_USE_VERSION=35'],
Expand Down
5 changes: 4 additions & 1 deletion site_scons/site_tools/compiler_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from SCons.Script import Configure, Exit, GetOption

DESIRED_FLAGS = ['-fstack-usage',
'-fsanitize=address',
'-fno-omit-frame-pointer',
'-Wno-sign-compare',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
Expand All @@ -13,7 +15,7 @@
'-Wno-unused-command-line-argument',
'-Wmismatched-dealloc',
'-Wfree-nonheap-object',
'-Wframe-larger-than=4096']
'-Wframe-larger-than=8192']

# Compiler flags to prevent optimizing out security checks
DESIRED_FLAGS.extend(['-fno-strict-overflow', '-fno-delete-null-pointer-checks', '-fwrapv'])
Expand Down Expand Up @@ -53,6 +55,7 @@ def _base_setup(env):
env.Append(CCFLAGS=['-g', '-Wextra', '-Wshadow', '-Wall', '-fpic'])

env.AppendIfSupported(CCFLAGS=DESIRED_FLAGS)
env.AppendIfSupported(LINKFLAGS=['-fsanitize=address'])

if '-Wmismatched-dealloc' in env['CCFLAGS']:
env.AppendUnique(CPPDEFINES={'HAVE_DEALLOC': '1'})
Expand Down
4 changes: 3 additions & 1 deletion src/control/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_build_flags(benv):
if is_release_build(benv):
return '-buildmode=pie'
# enable race detector for non-release builds
return '-race'
return ''


def gen_build_id():
Expand Down Expand Up @@ -127,6 +127,8 @@ def scons():
# Sets CGO_LDFLAGS for rpath options
denv.d_add_rpaths("..", True, True)
denv.AppendENVPath("CGO_CFLAGS", denv.subst("$_CPPINCFLAGS"), sep=" ")
denv.AppendENVPath("CGO_CFLAGS", "-fsanitize=address", sep=" ")
denv.AppendENVPath("CGO_LDFLAGS", "-fsanitize=address", sep=" ")
if prereqs.client_requested():
install_go_bin(denv, "daos_agent")
install_go_bin(denv, "dmg", install_man=True)
Expand Down
2 changes: 1 addition & 1 deletion utils/build.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
component=daos

[commit_versions]
ARGOBOTS = v1.1
ARGOBOTS = v1.2
FUSE = fuse-3.16.2
PMDK = 2.0.0
ISAL = v2.30.0
Expand Down
1 change: 1 addition & 0 deletions utils/rpms/daos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ BuildRequires: systemd-rpm-macros
%endif
%endif
BuildRequires: libuuid-devel
BuildRequires: libasan

%if (0%{?suse_version} > 0)
BuildRequires: libucp-devel
Expand Down
3 changes: 2 additions & 1 deletion utils/scripts/install-el8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ dnf --nodocs install \
systemd \
valgrind-devel \
which \
yasm
yasm \
libasan

# ipmctl is only available on x86_64
if [ "$arch" = x86_64 ]; then
Expand Down
3 changes: 2 additions & 1 deletion utils/scripts/install-el9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ dnf --nodocs install \
sudo \
valgrind-devel \
which \
yasm
yasm \
libasan
3 changes: 2 additions & 1 deletion utils/scripts/install-leap15.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ dnf --nodocs install \
sudo \
valgrind-devel \
which \
yasm
yasm \
libasan

# ipmctl is only available on x86_64
if [ "$arch" = x86_64 ]; then
Expand Down

0 comments on commit ac668a8

Please sign in to comment.