mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
UTest: Enable sanitizer for utest. (#3247)
1. Enable sanitizer for utest. 2. Allow auto detect jobs for make. 3. Show more information about build cache.
This commit is contained in:
parent
5bae930621
commit
88641b535c
9 changed files with 29 additions and 29 deletions
4
.github/workflows/codeql-analysis.yml
vendored
4
.github/workflows/codeql-analysis.yml
vendored
|
@ -27,8 +27,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "pwd: $(pwd), who: $(whoami)"
|
echo "pwd: $(pwd), who: $(whoami)"
|
||||||
docker run --rm -v $(pwd):$(pwd) -w $(pwd)/trunk ossrs/srs:ubuntu20-cache \
|
docker run --rm -v $(pwd):$(pwd) -w $(pwd)/trunk ossrs/srs:ubuntu20-cache \
|
||||||
bash -c "./configure --jobs=2 && chmod 777 -R objs"
|
bash -c "./configure && chmod 777 -R objs"
|
||||||
cd trunk && ./configure --jobs=2 && make -j2
|
cd trunk && ./configure && make
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v2
|
||||||
|
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -134,7 +134,7 @@ jobs:
|
||||||
run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest'
|
run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest'
|
||||||
# For regression-test
|
# For regression-test
|
||||||
- name: Run SRS regression-test
|
- name: Run SRS regression-test
|
||||||
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
run: docker run --rm srs:test bash -c 'make && (./objs/srs -c conf/regression-test.conf; ./etc/init.d/srs status) && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
name: coverage
|
name: coverage
|
||||||
|
|
|
@ -4,9 +4,8 @@ FROM ${ARCH}${IMAGE} AS build
|
||||||
|
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG JOBS=2
|
|
||||||
ARG SRS_AUTO_PACKAGER
|
ARG SRS_AUTO_PACKAGER
|
||||||
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, JOBS: $JOBS, PACKAGER: ${#SRS_AUTO_PACKAGER}"
|
RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM, PACKAGER: ${#SRS_AUTO_PACKAGER}"
|
||||||
|
|
||||||
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
|
# https://serverfault.com/questions/949991/how-to-install-tzdata-on-a-ubuntu-docker-image
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
@ -24,7 +23,7 @@ WORKDIR /srs/trunk
|
||||||
|
|
||||||
# Build and install SRS.
|
# Build and install SRS.
|
||||||
# Note that SRT is enabled by default, so we configure without --srt=on.
|
# Note that SRT is enabled by default, so we configure without --srt=on.
|
||||||
RUN ./configure --jobs=${JOBS} --gb28181=on --sanitizer-static=on && make -j${JOBS} && make install
|
RUN ./configure --gb28181=on --sanitizer-static=on && make && make install
|
||||||
|
|
||||||
# All config files for SRS.
|
# All config files for SRS.
|
||||||
RUN cp -R conf /usr/local/srs/conf && \
|
RUN cp -R conf /usr/local/srs/conf && \
|
||||||
|
|
|
@ -1,74 +1,74 @@
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:dev-cache AS centos7-baseline
|
FROM ossrs/srs:dev-cache AS centos7-baseline
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:dev-cache AS centos7-no-webrtc
|
FROM ossrs/srs:dev-cache AS centos7-no-webrtc
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --rtc=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --rtc=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:dev-cache AS centos7-no-asm
|
FROM ossrs/srs:dev-cache AS centos7-no-asm
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --nasm=off --srtp-nasm=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --nasm=off --srtp-nasm=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:dev-cache AS centos7-all
|
FROM ossrs/srs:dev-cache AS centos7-all
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2
|
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make
|
||||||
|
|
||||||
FROM ossrs/srs:dev-cache AS centos7-ansi-no-ffmpeg
|
FROM ossrs/srs:dev-cache AS centos7-ansi-no-ffmpeg
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --cxx11=off --cxx14=off --ffmpeg-fit=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --ffmpeg-fit=off && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:dev6-cache AS centos6-baseline
|
FROM ossrs/srs:dev6-cache AS centos6-baseline
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off --cxx11=off --cxx14=off --sanitizer=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --sanitizer=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:dev6-cache AS centos6-all
|
FROM ossrs/srs:dev6-cache AS centos6-all
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on --cxx11=off --cxx14=off --sanitizer=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on --cxx11=off --cxx14=off --sanitizer=off && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:ubuntu16-cache AS ubuntu16-baseline
|
FROM ossrs/srs:ubuntu16-cache AS ubuntu16-baseline
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:ubuntu16-cache AS ubuntu16-all
|
FROM ossrs/srs:ubuntu16-cache AS ubuntu16-all
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2
|
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:ubuntu18-cache AS ubuntu18-baseline
|
FROM ossrs/srs:ubuntu18-cache AS ubuntu18-baseline
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:ubuntu18-cache AS ubuntu18-all
|
FROM ossrs/srs:ubuntu18-cache AS ubuntu18-all
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2
|
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:ubuntu20-cache AS ubuntu20-baseline
|
FROM ossrs/srs:ubuntu20-cache AS ubuntu20-baseline
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=off --gb28181=off && make -j2
|
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off && make
|
||||||
|
|
||||||
FROM ossrs/srs:ubuntu20-cache AS ubuntu20-all
|
FROM ossrs/srs:ubuntu20-cache AS ubuntu20-all
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --srt=on --gb28181=on && make -j2
|
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:ubuntu16-cross-arm AS ubuntu16-cross-armv7
|
FROM ossrs/srs:ubuntu16-cross-arm AS ubuntu16-cross-armv7
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=arm-linux-gnueabihf- && make -j2
|
RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=arm-linux-gnueabihf- && make
|
||||||
|
|
||||||
FROM ossrs/srs:ubuntu16-cross-aarch64 AS ubuntu16-cross-aarch64
|
FROM ossrs/srs:ubuntu16-cross-aarch64 AS ubuntu16-cross-aarch64
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=aarch64-linux-gnu- && make -j2
|
RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=aarch64-linux-gnu- && make
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
FROM ossrs/srs:ubuntu20-cross-arm AS ubuntu20-cross-armv7
|
FROM ossrs/srs:ubuntu20-cross-arm AS ubuntu20-cross-armv7
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=arm-linux-gnueabihf- && make -j2
|
RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=arm-linux-gnueabihf- && make
|
||||||
|
|
||||||
FROM ossrs/srs:ubuntu20-cross-aarch64 AS ubuntu20-cross-aarch64
|
FROM ossrs/srs:ubuntu20-cross-aarch64 AS ubuntu20-cross-aarch64
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
RUN cd /srs/trunk && ./configure --jobs=2 --cross-build --cross-prefix=aarch64-linux-gnu- && make -j2
|
RUN cd /srs/trunk && ./configure --cross-build --cross-prefix=aarch64-linux-gnu- && make
|
||||||
|
|
|
@ -8,5 +8,5 @@ COPY . /srs
|
||||||
WORKDIR /srs/trunk
|
WORKDIR /srs/trunk
|
||||||
|
|
||||||
# Note that we must enable the gcc7 or link failed.
|
# Note that we must enable the gcc7 or link failed.
|
||||||
RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --gcov=on --sanitizer=off --jobs=2
|
RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --gcov=on --sanitizer=off
|
||||||
RUN scl enable devtoolset-7 -- make -j2 utest
|
RUN scl enable devtoolset-7 -- make utest
|
||||||
|
|
|
@ -10,5 +10,5 @@ RUN yum install -y zip
|
||||||
# Build and install SRS.
|
# Build and install SRS.
|
||||||
ADD srs-server-${version}.tar.gz /srs
|
ADD srs-server-${version}.tar.gz /srs
|
||||||
WORKDIR /srs/srs-server-${version}/trunk
|
WORKDIR /srs/srs-server-${version}/trunk
|
||||||
RUN ./scripts/package.sh --x86-x64 --jobs=2 --tag=${version}
|
RUN ./scripts/package.sh --x86-x64 --tag=${version}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ COPY . /srs
|
||||||
WORKDIR /srs/trunk
|
WORKDIR /srs/trunk
|
||||||
|
|
||||||
# Note that we must enable the gcc7 or link failed.
|
# Note that we must enable the gcc7 or link failed.
|
||||||
RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on --sanitizer=off --jobs=2
|
RUN scl enable devtoolset-7 -- ./configure --srt=on --gb28181=on --utest=on
|
||||||
RUN scl enable devtoolset-7 -- make -j2 utest
|
RUN scl enable devtoolset-7 -- make utest
|
||||||
|
|
||||||
# Build benchmark tool.
|
# Build benchmark tool.
|
||||||
RUN cd 3rdparty/srs-bench && make
|
RUN cd 3rdparty/srs-bench && make
|
||||||
|
|
|
@ -326,6 +326,7 @@ if [[ -d /usr/local/srs-cache/srs/trunk/objs && $(pwd) != "/usr/local/srs-cache/
|
||||||
echo "Build from cache, source=$SOURCE_DIR, target=$TARGET_DIR" &&
|
echo "Build from cache, source=$SOURCE_DIR, target=$TARGET_DIR" &&
|
||||||
rm -rf $TARGET_DIR && mkdir -p ${SRS_OBJS} && cp -R $SOURCE_DIR $TARGET_DIR &&
|
rm -rf $TARGET_DIR && mkdir -p ${SRS_OBJS} && cp -R $SOURCE_DIR $TARGET_DIR &&
|
||||||
du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-* &&
|
du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-* &&
|
||||||
|
du -sh /usr/local/srs-cache/srs/trunk/objs/Platform-*/* &&
|
||||||
du -sh objs/Platform-* &&
|
du -sh objs/Platform-* &&
|
||||||
ls -lh objs
|
ls -lh objs
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2333,7 +2333,7 @@ srs_error_t SrsRecoverablePsContext::decode_rtp(SrsBuffer* stream, int reserved,
|
||||||
SrsRtpPacket rtp;
|
SrsRtpPacket rtp;
|
||||||
int pos = stream->pos();
|
int pos = stream->pos();
|
||||||
if ((err = rtp.decode(stream)) != srs_success) {
|
if ((err = rtp.decode(stream)) != srs_success) {
|
||||||
return enter_recover_mode(stream, handler, pos, err = srs_error_new(ERROR_GB_PS_HEADER, "decode rtp"));
|
return enter_recover_mode(stream, handler, pos, srs_error_wrap(err, "decode rtp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsRtpRawPayload* rtp_raw = dynamic_cast<SrsRtpRawPayload*>(rtp.payload());
|
SrsRtpRawPayload* rtp_raw = dynamic_cast<SrsRtpRawPayload*>(rtp.payload());
|
||||||
|
|
Loading…
Reference in a new issue