Commit 923edebd authored by Robert Schmidt's avatar Robert Schmidt

Enable Address Sanitizer on physical simulators

- install libasan in physim containers
- run physim containers with SYS_CAP_PTRACE capability
- remove static-libasan: not available in RHEL8:

  The physims are tested in a container environment on top of RHEL8. To
  my knowledge, no package provides the static ASan library there.
  Therefore, remove it here to be able to run these tests.
parent 86c48822
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -33,7 +33,9 @@ podSecurityContext:
securityContext:
privileged: true
# capabilities:
capabilities:
add:
- SYS_CAP_PTRACE
# drop:
# - ALL
# readOnlyRootFilesystem: true
......
......@@ -343,8 +343,8 @@ set(CMAKE_CXX_FLAGS
if (SANITIZE_ADDRESS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -static-libasan -fno-common")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fno-common")
endif ()
add_definitions("-DASN_DISABLE_OER_SUPPORT")
......
......@@ -31,11 +31,14 @@ RUN rm -Rf /oai-ran
WORKDIR /oai-ran
COPY . .
#only install address sanitizer for this container, the others don't need it
RUN yum install -y libasan
#run build_oai to build the target image
RUN /bin/sh oaienv && \
cd cmake_targets && \
mkdir -p log && \
./build_oai --phy_simulators --ninja --verbose-ci
./build_oai --phy_simulators -g --ninja --verbose-ci --sanitize-address
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-physim
......@@ -85,6 +88,7 @@ COPY --from=phy-sim-build \
/lib64/liblapack.so.3 \
/lib64/libexslt.so.0 \
/lib64/libxslt.so.1 \
/usr/lib64/libasan.so.5 \
/oai-ran/cmake_targets/ran_build/build/libdfts.so \
/oai-ran/cmake_targets/ran_build/build/libSIMU.so \
/oai-ran/cmake_targets/ran_build/build/libldpc.so \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment