Skip to content

Commit

Permalink
Add msan and allow it to fail on ga, remove mbedtls and msan from travis
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Dec 13, 2021
1 parent 332d7cc commit fcabee7
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 105 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ jobs:
undefined-behavior-sanitizer:
runs-on: ubuntu-18.04
continue-on-error: true
env:
UBSAN_OPTIONS: halt_on_error=1
steps:
Expand Down Expand Up @@ -107,7 +106,6 @@ jobs:
uses: actions/checkout@v2
- name: Build repository
run: |
# TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
mkdir build
cd build
Expand All @@ -117,6 +115,22 @@ jobs:
ulimit -c unlimited -S
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test
memory-sanitizer:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Build repository
continue-on-error: true
run: |
echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
mkdir build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE
make
export AWS_KVS_LOG_LEVEL=3
ulimit -c unlimited -S
timeout --signal=SIGABRT 60m ./tst/webrtc_client_test
mbedtls-ubuntu:
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ matrix:
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
before_script: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TEST=TRUE -DUNDEFINED_BEHAVIOR_SANITIZER=TRUE

# MemorySanitizer
- name: "Linux Clang MemorySanitizer"
env: allowTestFail=true
before_install:
# TODO: Remove the following 2 lines. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart
- mkdir build
- docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -w /src/build -dit --name msan-tester -v $(pwd):/src seaduboi/kvs-msan-tester
- msan-tester() { docker exec -it msan-tester "$@"; }
script:
- msan-tester cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEPENDENCIES=FALSE -DBUILD_TEST=TRUE -DMEMORY_SANITIZER=TRUE -DCMAKE_CXX_FLAGS="-stdlib=libc++ -L/usr/src/libcxx_msan/lib -lc++abi -I/usr/src/libcxx_msan/include -I/usr/src/libcxx_msan/include/c++/v1 -fsanitize=memory -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins"
- msan-tester make
- msan-tester ./tst/webrtc_client_test
after_failure: skip # no coredumps in container

# Old Version GCC 4.4
- name: "Linux GCC 4.4 Build"
os: linux
Expand Down Expand Up @@ -154,26 +138,6 @@ matrix:
- cmake .. -DBUILD_OPENSSL=TRUE -DBUILD_OPENSSL_PLATFORM=linux-generic32 -DBUILD_LIBSRTP_HOST_PLATFORM=x86_64-unknown-linux-gnu -DBUILD_LIBSRTP_DESTINATION_PLATFORM=arm-unknown-linux-uclibcgnueabi
script: make

- name: "mbedTLS - Linux GCC 4.4 Build"
os: linux
compiler: gcc
before_install:
# TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -q update
- sudo apt-get -y install gcc-4.4
- sudo apt-get -y install gdb
before_script: mkdir build && cd build && cmake .. -DBUILD_TEST=TRUE -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON

- name: "mbedTLS - Linux Clang"
os: linux
compiler: clang
before_install:
# TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
before_script: mkdir build && cd build && cmake .. -DBUILD_TEST=TRUE -DUSE_OPENSSL=OFF -DUSE_MBEDTLS=ON

- name: "Windows MSVC"
env: allowTestFail=true
os: windows
Expand Down
6 changes: 3 additions & 3 deletions samples/kvsWebRTCClientMaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ PVOID sendVideoPackets(PVOID args)

CHK_LOG_ERR(retStatus);

return (PVOID)(ULONG_PTR) retStatus;
return (PVOID) (ULONG_PTR) retStatus;
}

PVOID sendAudioPackets(PVOID args)
Expand Down Expand Up @@ -360,7 +360,7 @@ PVOID sendAudioPackets(PVOID args)

CleanUp:

return (PVOID)(ULONG_PTR) retStatus;
return (PVOID) (ULONG_PTR) retStatus;
}

PVOID sampleReceiveVideoFrame(PVOID args)
Expand All @@ -380,5 +380,5 @@ PVOID sampleReceiveVideoFrame(PVOID args)

CleanUp:

return (PVOID)(ULONG_PTR) retStatus;
return (PVOID) (ULONG_PTR) retStatus;
}
27 changes: 14 additions & 13 deletions src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h
Original file line number Diff line number Diff line change
Expand Up @@ -1181,19 +1181,20 @@ typedef struct {
* @brief Populate Signaling client with client ID and application log level
*/
typedef struct {
UINT32 version; //!< Version of the structure
CHAR clientId[MAX_SIGNALING_CLIENT_ID_LEN + 1]; //!< Client id to use. Defines if the client is a producer/consumer
UINT32 loggingLevel; //!< Verbosity level for the logging. One of LOG_LEVEL_XXX
//!< values or the default verbosity will be assumed. Currently,
//!< default value is LOG_LEVEL_WARNING
PCHAR cacheFilePath; //!< File cache path override. The default
//!< path is "./.SignalingCache_vN" which might not work for
//!< devices which have read only partition where the code is
//!< located. For default value or when file caching is not
//!< being used this value can be NULL or point to an EMPTY_STRING.
KvsRetryStrategyCallbacks signalingRetryStrategyCallbacks; //!< Retry strategy callbacks used while creating signaling client
INT32 signalingClientCreationMaxRetryAttempts; //!< Max attempts to create signaling client before returning error to the caller
UINT32 stateMachineRetryCountReadOnly; //!< Retry count of state machine. Note that this **MUST NOT** be modified by the user. It is a read only field
UINT32 version; //!< Version of the structure
CHAR clientId[MAX_SIGNALING_CLIENT_ID_LEN + 1]; //!< Client id to use. Defines if the client is a producer/consumer
UINT32 loggingLevel; //!< Verbosity level for the logging. One of LOG_LEVEL_XXX
//!< values or the default verbosity will be assumed. Currently,
//!< default value is LOG_LEVEL_WARNING
PCHAR cacheFilePath; //!< File cache path override. The default
//!< path is "./.SignalingCache_vN" which might not work for
//!< devices which have read only partition where the code is
//!< located. For default value or when file caching is not
//!< being used this value can be NULL or point to an EMPTY_STRING.
KvsRetryStrategyCallbacks signalingRetryStrategyCallbacks; //!< Retry strategy callbacks used while creating signaling client
INT32 signalingClientCreationMaxRetryAttempts; //!< Max attempts to create signaling client before returning error to the caller
UINT32 stateMachineRetryCountReadOnly; //!< Retry count of state machine. Note that this **MUST NOT** be modified by the user. It is a read only
//!< field
} SignalingClientInfo, *PSignalingClientInfo;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/source/PeerConnection/PeerConnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ STATUS addTransceiver(PRtcPeerConnection pPeerConnection, PRtcMediaStreamTrack p
}

CHK(pKvsPeerConnection != NULL, STATUS_NULL_ARG);

if (direction == RTC_RTP_TRANSCEIVER_DIRECTION_RECVONLY && pRtcMediaStreamTrack == NULL) {
MEMSET(&videoTrack, 0x00, SIZEOF(RtcMediaStreamTrack));
videoTrack.kind = MEDIA_STREAM_TRACK_KIND_VIDEO;
Expand Down
12 changes: 6 additions & 6 deletions src/source/Signaling/Client.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ STATUS createSignalingClientSync(PSignalingClientInfo pClientInfo, PChannelInfo

CHK_STATUS(createRetryStrategyForCreatingSignalingClient(pClientInfo, &createSignalingClientRetryStrategy));


if(pClientInfo->signalingClientCreationMaxRetryAttempts == CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS_SENTINEL_VALUE) {
if (pClientInfo->signalingClientCreationMaxRetryAttempts == CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS_SENTINEL_VALUE) {
signalingClientCreationMaxRetryCount = DEFAULT_CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS;
} else {
signalingClientCreationMaxRetryCount = pClientInfo->signalingClientCreationMaxRetryAttempts;
Expand Down Expand Up @@ -197,7 +196,7 @@ STATUS signalingClientFetchSync(SIGNALING_CLIENT_HANDLE signalingClientHandle)
CHK_STATUS(createRetryStrategyForCreatingSignalingClient(&pSignalingClient->clientInfo.signalingClientInfo, &createSignalingClientRetryStrategy));

signalingClientCreationMaxRetryCount = pSignalingClient->clientInfo.signalingClientInfo.signalingClientCreationMaxRetryAttempts;
if(signalingClientCreationMaxRetryCount == CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS_SENTINEL_VALUE) {
if (signalingClientCreationMaxRetryCount == CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS_SENTINEL_VALUE) {
signalingClientCreationMaxRetryCount = DEFAULT_CREATE_SIGNALING_CLIENT_RETRY_ATTEMPTS;
}

Expand All @@ -215,11 +214,12 @@ STATUS signalingClientFetchSync(SIGNALING_CLIENT_HANDLE signalingClientHandle)
break;
}

pSignalingClient->clientInfo.signalingClientInfo.stateMachineRetryCountReadOnly = signalingClientInfoInternal.signalingClientInfo.stateMachineRetryCountReadOnly;
pSignalingClient->clientInfo.signalingClientInfo.stateMachineRetryCountReadOnly =
signalingClientInfoInternal.signalingClientInfo.stateMachineRetryCountReadOnly;

// Wait before attempting to create signaling client
CHK_STATUS(pSignalingClient->clientInfo.signalingStateMachineRetryStrategyCallbacks.executeRetryStrategyFn(&createSignalingClientRetryStrategy,
&signalingClientCreationWaitTime));
CHK_STATUS(pSignalingClient->clientInfo.signalingStateMachineRetryStrategyCallbacks.executeRetryStrategyFn(
&createSignalingClientRetryStrategy, &signalingClientCreationWaitTime));

DLOGV("Attempting to back off for [%lf] milliseconds before creating signaling client again. "
"Signaling client creation retry count [%u]",
Expand Down
Loading

0 comments on commit fcabee7

Please sign in to comment.