From 8da7bcfd61cc896907d5bda323fda9b5bc0e92b4 Mon Sep 17 00:00:00 2001 From: Tamas K Lengyel Date: Fri, 4 Oct 2019 20:24:35 -0700 Subject: [PATCH] Travis CI updates (#709) * Use clang-10 for scan-build * Enable sanitize option for debug build * Disable some errors and error limit * Fix reorder-init-list warnings --- .travis.yml | 27 ++++++++++++++++++++------- src/Makefile.am | 2 +- src/plugins/Makefile.am | 3 ++- src/plugins/syscalls/commonscproto.h | 2 +- src/plugins/syscalls/syscalls.cpp | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 467c6e7db..d98565828 100644 --- a/.travis.yml +++ b/.travis.yml @@ -118,7 +118,7 @@ matrix: install: - ./autogen.sh script: - - ./configure --enable-debug || cat config.log + - ./configure --enable-debug --enable-sanitize || cat config.log - make - env: @@ -184,10 +184,23 @@ matrix: # clang scan-build # - env: - - TEST="scan-build" + - TEST="scan-build" CXX_COMPILER=clang++-10 CXX_STDLIB=g++-9 + addons: + apt: + packages: + - clang-10 + - clang-tools-10 + - g++-9 + - bison + - flex + - libjson-c-dev + - autoconf-archive + - libxen-dev + sources: + - sourceline: 'ppa:ubuntu-toolchain-r/test' + - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' before_install: - - sudo apt-get update - - sudo apt-get -q -y install bison flex libjson-c-dev autoconf-archive libxen-dev - export INSTALLDIR=$PWD/usr/local/ - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/usr/local/lib - export C_INCLUDE_PATH=$PWD/usr/local/include @@ -195,6 +208,7 @@ matrix: - export PKG_CONFIG_PATH="$PWD/usr/local/lib/pkgconfig/" - export LDFLAGS="-L$PWD/usr/local/lib" - export CFLAGS="-I$PWD/usr/local/include" + install: - git submodule update --init libvmi - cd libvmi - autoreconf -vif @@ -202,11 +216,10 @@ matrix: - make - make install - cd .. - install: - ./autogen.sh script: - - scan-build --status-bugs --use-cc=clang --use-c++=clang++ -analyze-headers -disable-checker deadcode.DeadStores ./configure --enable-debug - - scan-build --status-bugs --use-cc=clang --use-c++=clang++ -analyze-headers -disable-checker deadcode.DeadStores make + - scan-build-10 --status-bugs --use-cc=clang-10 --use-c++=clang++-10 -analyze-headers -disable-checker deadcode.DeadStores ./configure --enable-debug + - scan-build-10 --status-bugs --use-cc=clang-10 --use-c++=clang++-10 -analyze-headers -disable-checker deadcode.DeadStores make # # SonarCloud diff --git a/src/Makefile.am b/src/Makefile.am index dbdd0210d..eb1afb06b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -140,7 +140,7 @@ if DEBUG AM_CFLAGS += -DDRAKVUF_DEBUG -Werror -Wall -Wextra -g -ggdb3 AM_CFLAGS += -Wno-missing-field-initializers AM_CXXFLAGS += -DDRAKVUF_DEBUG -Werror -Wall -Wextra -g -ggdb3 -AM_CXXFLAGS += -Wno-missing-field-initializers +AM_CXXFLAGS += -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-c99-designator -ferror-limit=0 if !HARDENING AM_CFLAGS += -pg AM_CXXFLAGS += -pg diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index a3096bcaa..5ebea049d 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -221,7 +221,8 @@ endif if DEBUG AM_CXXFLAGS += -DDRAKVUF_DEBUG -Werror -Wall -Wextra -g -ggdb3 AM_CXXFLAGS += -Wno-missing-field-initializers -Wno-unused-parameter -AM_CXXFLAGS += -Wno-initializer-overrides +AM_CXXFLAGS += -Wno-initializer-overrides -Wno-unknown-warning-option +AM_CXXFLAGS += -Wno-c99-designator -ferror-limit=0 -Wno-reorder-init-list AM_CXXFLAGS += -Wcast-qual -Wcast-align -Wstrict-aliasing \ -Wpointer-arith -Winit-self -Wshadow \ -Wredundant-decls -Wfloat-equal -Wundef \ diff --git a/src/plugins/syscalls/commonscproto.h b/src/plugins/syscalls/commonscproto.h index 4aa0c9352..74c8abf4f 100644 --- a/src/plugins/syscalls/commonscproto.h +++ b/src/plugins/syscalls/commonscproto.h @@ -427,8 +427,8 @@ typedef struct { const char* name; arg_direction_t dir; - type_t type; const char* dir_opt; + type_t type; } arg_t; typedef struct diff --git a/src/plugins/syscalls/syscalls.cpp b/src/plugins/syscalls/syscalls.cpp index db7b0a415..bfa10bb18 100644 --- a/src/plugins/syscalls/syscalls.cpp +++ b/src/plugins/syscalls/syscalls.cpp @@ -391,8 +391,8 @@ static int linux_build_argbuf(void* buf, vmi_instance_t vmi, drakvuf_trap_info_t access_context_t ctx = { .translate_mechanism = VMI_TM_PROCESS_DTB, - .dtb = info->regs->cr3, .addr = info->regs->rdi, + .dtb = info->regs->cr3 }; rc = vmi_read(vmi, &ctx, sizeof(lr), &lr, NULL);