Skip to content

Commit

Permalink
DAOS-15799 build: Add libsanitize
Browse files Browse the repository at this point in the history
Update default SCons options to generate RPMs with code instrumented
with libasan.
Miscellaneous fixes for building with CI.

Skip-test: true
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@intel.com>
  • Loading branch information
kanard38 authored and knard-intel committed Jun 6, 2024
1 parent 855d80e commit daf66c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2023 Intel Corporation
# Copyright 2016-2024 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -445,7 +445,7 @@ def __init__(self, env, opts):
opts.Add(BoolVariable('FIRMWARE_MGMT', 'Build in device firmware management.', 0))
opts.Add(BoolVariable('STACK_MMAP', 'Allocate ABT ULTs stacks with mmap()', 0))
opts.Add(BoolVariable('ADDRESS_SANITIZER',
'Instrument C code with the Address Sanitizer library', 0))
'Instrument C code with the Address Sanitizer library', 1))
opts.Add(EnumVariable('BUILD_TYPE', "Set the build type", 'release',
['dev', 'debug', 'release'], ignorecase=1))
opts.Add(EnumVariable('TARGET_TYPE', "Set the prerequisite type", 'default',
Expand Down
2 changes: 1 addition & 1 deletion site_scons/site_tools/compiler_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'-Wno-gnu-zero-variadic-macro-arguments',
'-Wno-tautological-constant-out-of-range-compare',
'-Wno-unused-command-line-argument',
'-Wframe-larger-than=4096']
'-Wframe-larger-than=8182']

# Compiler flags to prevent optimizing out security checks
DESIRED_FLAGS.extend(['-fno-strict-overflow', '-fno-delete-null-pointer-checks',
Expand Down
8 changes: 4 additions & 4 deletions src/client/dfs/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ dfs_global2local_all(int flags, d_iov_t glob, dfs_t **_dfs)

ptr = (char *)glob.iov_buf;

strncpy(pool, ptr, DAOS_PROP_LABEL_MAX_LEN + 1);
strncpy(pool, ptr, DAOS_PROP_LABEL_MAX_LEN);
pool[DAOS_PROP_LABEL_MAX_LEN] = 0;
pool_len = strlen(pool) + 1;
ptr += pool_len;
Expand All @@ -2934,7 +2934,7 @@ dfs_global2local_all(int flags, d_iov_t glob, dfs_t **_dfs)
D_GOTO(err, rc);
pool_h_bump = true;

strncpy(cont, ptr, DAOS_PROP_LABEL_MAX_LEN + 1);
strncpy(cont, ptr, DAOS_PROP_LABEL_MAX_LEN);
cont[DAOS_PROP_LABEL_MAX_LEN] = 0;
cont_len = strlen(cont) + 1;
ptr += cont_len;
Expand Down Expand Up @@ -4537,7 +4537,7 @@ dfs_obj_local2global(dfs_t *dfs, dfs_obj_t *obj, d_iov_t *glob)
oid_cp(&obj_glob->parent_oid, obj->parent_oid);
uuid_copy(obj_glob->coh_uuid, coh_uuid);
uuid_copy(obj_glob->cont_uuid, cont_uuid);
strncpy(obj_glob->name, obj->name, DFS_MAX_NAME + 1);
strncpy(obj_glob->name, obj->name, DFS_MAX_NAME);
obj_glob->name[DFS_MAX_NAME] = 0;
rc = dfs_get_chunk_size(obj, &obj_glob->chunk_size);
if (rc)
Expand Down Expand Up @@ -4593,7 +4593,7 @@ dfs_obj_global2local(dfs_t *dfs, int flags, d_iov_t glob, dfs_obj_t **_obj)

oid_cp(&obj->oid, obj_glob->oid);
oid_cp(&obj->parent_oid, obj_glob->parent_oid);
strncpy(obj->name, obj_glob->name, DFS_MAX_NAME + 1);
strncpy(obj->name, obj_glob->name, DFS_MAX_NAME);
obj->name[DFS_MAX_NAME] = '\0';
obj->mode = obj_glob->mode;
obj->flags = flags ? flags : obj_glob->flags;
Expand Down

0 comments on commit daf66c0

Please sign in to comment.