Commit 0098b227 authored by Jonas Svedberg's avatar Jonas Svedberg
Browse files

merged from mainn, option.h aligned, EVS-mono comment removed in cng_dec.c

parents cff9a68e 770da975
Loading
Loading
Loading
Loading
Loading
+52 −1
Original line number Diff line number Diff line
@@ -281,11 +281,13 @@ build-codec-instrumented-linux:
# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends:
    - .build-job-linux
    - .build-job-with-check-for-warnings
    - .rules-basis
  script:
    - *print-common-info
    - bash ci/build_codec_sanitizers_linux.sh
    # need to use the "|| exit $?" suffix to get the allowed_failure return code, otherwise the job fails with code 1...<
    - ci/check_for_warnings.py $BUILD_OUTPUT || exit $?

build-codec-windows-cmake:
  extends:
@@ -386,6 +388,28 @@ codec-asan:
      - test_output.txt
    expose_as: "asan selftest results"

# code selftest testvectors with address-sanitizer binaries
codec-usan:
  extends:
    - .test-job-linux
    - .rules-merge-request
  stage: test
  needs: ["build-codec-sanitizers-linux"]
  script:
    - *print-common-info
    - make clean
    - make -j CLANG=3
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1 python3 scripts/self_test.py --create
    - grep_exit_code=0
    - grep UndefinedBehaviorSanitizer scripts/ref/logs/* || grep_exit_code=$?
    - if [ $grep_exit_code != 1 ] ; then echo "Run errors in self_test.py with Clang undefined-behavior-sanitizer"; exit 1; fi
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    paths:
      - scripts/ref/logs/
    expose_as: "usan selftest results"

# test renderer executable
renderer-smoke-test:
  extends:
@@ -453,6 +477,33 @@ renderer-msan:
      junit:
        - report-junit.xml

# test renderer executable with cmake + usan
renderer-usan:
  extends:
    - .test-job-linux
    - .rules-merge-request
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=usan  -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1,log_path=usan_log_catchall python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py
    - grep_exit_code=0
    - touch usan_log_empty # Creates an empty file, this is to avoid "grep: usan_log_*: No such file or directory" in case no USAN failures are reported from pytest
    - grep UndefinedBehaviorSanitizer usan_log_* || grep_exit_code=$?
    - if [ $grep_exit_code != 1 ] ; then echo "Run errors in test_renderer.py with Clang undefined-behavior-sanitizer"; exit 1; fi

  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
    expose_as: "renderer usan pytest results"
    reports:
      junit:
        - report-junit.xml

# compare renderer bitexactness between target and source branch
renderer-pytest-on-merge-request:
  extends:
+14 −2
Original line number Diff line number Diff line
@@ -70,8 +70,20 @@ if(UNIX)
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
    elseif("${CLANG}" MATCHES "3" OR "${CLANG}" MATCHES "usan")
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined")
      # NOTE: keep in sync with list in Makefile
      set(USAN_CHECKS_ENABLE
        undefined # Default checks
        # Extra checks
        float-divide-by-zero
        implicit-conversion
        local-bounds
      )
      list(JOIN USAN_CHECKS_ENABLE "," USAN_CHECKS_ENABLE)

      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${USAN_CHECKS_ENABLE} -fsanitize-recover=${USAN_CHECKS_ENABLE}")
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${USAN_CHECKS_ENABLE} -fsanitize-recover=${USAN_CHECKS_ENABLE}")
    else()
      message(FATAL_ERROR "Unknown CLANG setting: ${CLANG}")
    endif()
  endif()
  # GCOV
+6 −2
Original line number Diff line number Diff line
@@ -77,8 +77,12 @@ LDFLAGS += -fsanitize=address
endif
ifeq "$(CLANG)" "3"
CC       = $(CCCLANG) 
CFLAGS  += -fsanitize=undefined
LDFLAGS += -fsanitize=undefined
# NOTE: keep in sync with list in CMakeLists.txt
usan_checks = undefined,float-divide-by-zero,implicit-conversion,local-bounds
CFLAGS  += -fsanitize=$(usan_checks) 
CFLAGS  += -fsanitize-recover=$(usan_checks) 
LDFLAGS += -fsanitize=$(usan_checks)
LDFLAGS += -fsanitize-recover=$(usan_checks)
endif

ifeq "$(RELEASE)" "1"
+0 −3
Original line number Diff line number Diff line
@@ -271,10 +271,7 @@
    <ClCompile Include="..\lib_dec\ivas_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_decision_matrix_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_decorr_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_onsets_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_output_synthesis_cov.c" />
    <ClCompile Include="..\lib_dec\ivas_dirac_output_synthesis_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_entropy_decoder.c" />
    <ClCompile Include="..\lib_dec\ivas_init_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_ism_dec.c" />
+0 −9
Original line number Diff line number Diff line
@@ -16,15 +16,6 @@
    <ClCompile Include="..\lib_dec\ivas_dirac_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_dirac_decorr_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_dirac_onsets_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_dirac_output_synthesis_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_rom_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
Loading