* Defensive code for alloc/dealloc during TLS teardown If an allocation or deallocation occurs during TLS teardown, then it is possible for a new allocator to be created and then this is leaked. On the mimalloc-bench mstressN benchmark this was observed leading to a large memory leak. This fix, detects if we are in the TLS teardown phase, and if so, the calls to alloc or dealloc must return the allocator once they have perform the specific operation. Uses a separate variable to represent if a thread_local's destructor has run already. This is used to detect thread teardown to put the allocator into a special slow path to avoid leaks. * Added some printing first operation to track progress * Improve error messages on posix Flush errors, print assert details, and present stack traces. * Detect incorrect use of pool. * Clang format. * Replace broken LL/SC implementation LL/SC implementation was broken, this replaces it with a locking implementation. Changes the API to support LL/SC for future implementation on ARM. * Improve TLS teardown. * Make std::function fully inlined. * Factor out PALLinux stack trace. * Add checks for leaking allocators. * Add release build of Windows Clang
322 lines
7.5 KiB
YAML
322 lines
7.5 KiB
YAML
trigger:
|
|
- master
|
|
|
|
pr:
|
|
- master
|
|
|
|
jobs:
|
|
- job:
|
|
displayName: Linux
|
|
pool:
|
|
vmImage: 'ubuntu-18.04'
|
|
container: snmallocciteam/build_linux_x64:latest
|
|
|
|
strategy:
|
|
matrix:
|
|
Clang-7 Debug:
|
|
CC: clang-7
|
|
CXX: clang++-7
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Clang-7 Release:
|
|
CC: clang-7
|
|
CXX: clang++-7
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Clang-8 Debug:
|
|
CC: clang-8
|
|
CXX: clang++-8
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Clang-8 Release:
|
|
CC: clang-8
|
|
CXX: clang++-8
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Clang-9 Debug:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Clang-9 Release:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
GCC-8 Debug:
|
|
CC: gcc-8
|
|
CXX: g++-8
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
GCC-8 Release:
|
|
CC: gcc-8
|
|
CXX: g++-8
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
|
|
Self Host:
|
|
CC: clang-7
|
|
CXX: clang++-7
|
|
BuildType: Debug
|
|
SelfHost: true
|
|
CMakeArgs: ''
|
|
|
|
Cache Friendly:
|
|
CC: clang-7
|
|
CXX: clang++-7
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: '-DCACHE_FRIENDLY_OFFSET=64'
|
|
|
|
steps:
|
|
- script: |
|
|
ci/scripts/build.sh
|
|
env:
|
|
CC: $(CC)
|
|
CXX: $(CXX)
|
|
BUILD_TYPE: $(BuildType)
|
|
CMAKE_ARGS: $(CMakeArgs)
|
|
failOnStderr: true
|
|
displayName: 'Build'
|
|
|
|
- script: |
|
|
ci/scripts/test.sh
|
|
env:
|
|
SELF_HOST: $(SelfHost)
|
|
BUILD_TYPE: $(BuildType)
|
|
failOnStderr: true
|
|
displayName: 'Test'
|
|
|
|
- job:
|
|
displayName: 'ARM Linux'
|
|
pool:
|
|
vmImage: 'ubuntu-18.04'
|
|
|
|
strategy:
|
|
matrix:
|
|
64-bit Clang-9 Debug:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
Image: snmallocciteam/build_linux_arm64:latest
|
|
|
|
64-bit Clang-9 Release:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
Image: snmallocciteam/build_linux_arm64:latest
|
|
|
|
32-bit Clang-9 Debug:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Debug
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
Image: snmallocciteam/build_linux_armhf:latest
|
|
|
|
32-bit Clang-9 Release:
|
|
CC: clang-9
|
|
CXX: clang++-9
|
|
BuildType: Release
|
|
SelfHost: false
|
|
CMakeArgs: ''
|
|
Image: snmallocciteam/build_linux_armhf:latest
|
|
|
|
steps:
|
|
- script: |
|
|
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
|
displayName: 'Enable QEmu'
|
|
|
|
- script: |
|
|
sudo docker run -v $PWD:/src \
|
|
-e CC=$(CC) \
|
|
-e CXX=$(CXX) \
|
|
-e BUILD_TYPE=$(BuildType) \
|
|
-e CMAKE_ARGS=$(CMakeArgs) \
|
|
$(Image) \
|
|
ci/scripts/build.sh
|
|
displayName: 'Build'
|
|
|
|
- script: |
|
|
sudo docker run -v $PWD:/src \
|
|
-e BUILD_TYPE=$(BuildType) \
|
|
-e SELF_HOST=$(SelfHost) \
|
|
$(Image) \
|
|
ci/scripts/test.sh
|
|
displayName: 'Test'
|
|
|
|
- job:
|
|
displayName: Windows
|
|
pool:
|
|
vmImage: 'vs2017-win2016'
|
|
strategy:
|
|
matrix:
|
|
64-bit Debug:
|
|
BuildType: Debug
|
|
CMakeArgs: '-G"Visual Studio 15 2017 Win64"'
|
|
JFlag: -j 4
|
|
|
|
64-bit Release:
|
|
BuildType: Release
|
|
CMakeArgs: '-G"Visual Studio 15 2017 Win64"'
|
|
JFlag: '-j 2'
|
|
|
|
64-bit Release Windows8Compat:
|
|
BuildType: Release
|
|
CMakeArgs: '-G"Visual Studio 15 2017 Win64" -DWIN8COMPAT=TRUE'
|
|
JFlag: '-j 2'
|
|
|
|
32-bit Debug:
|
|
BuildType: Debug
|
|
CMakeArgs: '-G"Visual Studio 15 2017"'
|
|
JFlag: '-j 4'
|
|
|
|
32-bit Release:
|
|
BuildType: Release
|
|
CMakeArgs: '-G"Visual Studio 15 2017"'
|
|
JFlag: '-j 2'
|
|
|
|
steps:
|
|
- script: |
|
|
bash -c "cat /proc/cpuinfo"
|
|
bash -c "cat /proc/meminfo"
|
|
displayName: 'Machine stats'
|
|
|
|
- task: CMake@1
|
|
displayName: 'CMake .. $(CMakeArgs) -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On'
|
|
inputs:
|
|
cmakeArgs: '.. $(CMakeArgs) -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On'
|
|
|
|
- task: MSBuild@1
|
|
displayName: 'Build solution build/snmalloc.sln'
|
|
inputs:
|
|
solution: build/snmalloc.sln
|
|
msbuildArguments: '/m /p:Configuration=$(BuildType)'
|
|
|
|
- script: 'ctest $(JFlag) --interactive-debug-mode 0 --output-on-failure -C $(BuildType)'
|
|
workingDirectory: build
|
|
displayName: 'Run Ctest'
|
|
|
|
- job:
|
|
displayName: WinClang
|
|
pool:
|
|
vmImage: 'windows-2019'
|
|
strategy:
|
|
matrix:
|
|
64-bit Debug Clang:
|
|
BuildType: Debug
|
|
CMakeArgs: '-GNinja -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_RC_COMPILER="C:/Program Files/LLVM/bin/llvm-rc"'
|
|
JFlag: -j 4
|
|
64-bit Release Clang:
|
|
BuildType: Release
|
|
CMakeArgs: '-GNinja -DCMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_RC_COMPILER="C:/Program Files/LLVM/bin/llvm-rc"'
|
|
JFlag: -j 4
|
|
|
|
steps:
|
|
- script: |
|
|
bash -c "cat /proc/cpuinfo"
|
|
bash -c "cat /proc/meminfo"
|
|
displayName: 'Machine stats'
|
|
|
|
- script: |
|
|
choco install --accept-license -y Ninja llvm
|
|
displayName: 'Dependencies'
|
|
|
|
- script: |
|
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
|
|
mkdir build
|
|
cd build
|
|
cmake .. $(CMakeArgs) -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On
|
|
cmake --build . --config ${BuildType}
|
|
displayName: 'build'
|
|
|
|
- script: |
|
|
set PATH=%PATH%;"C:\Program Files\LLVM\bin\"
|
|
func-statistics-1.exe
|
|
ctest $(JFlag) --interactive-debug-mode 0 --output-on-failure -C $(BuildType)
|
|
|
|
workingDirectory: build
|
|
displayName: 'Run Ctest'
|
|
|
|
- job:
|
|
displayName: macOS
|
|
pool:
|
|
vmImage: 'macOS-10.15'
|
|
strategy:
|
|
matrix:
|
|
Debug:
|
|
BuildType: Debug
|
|
Release:
|
|
BuildType: Release
|
|
|
|
steps:
|
|
- task: CMake@1
|
|
displayName: 'CMake .. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On'
|
|
inputs:
|
|
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=$(BuildType) -DSNMALLOC_CI_BUILD=On -DSNMALLOC_RUST_SUPPORT=On'
|
|
|
|
- script: |
|
|
set -eo pipefail
|
|
make -j 4
|
|
|
|
workingDirectory: build
|
|
failOnStderr: true
|
|
displayName: 'Compile'
|
|
|
|
- script: |
|
|
set -eo pipefail
|
|
ctest -j 4 --output-on-failure -C $(BuildType)
|
|
|
|
workingDirectory: build
|
|
failOnStderr: true
|
|
displayName: 'Test'
|
|
|
|
- job:
|
|
displayName: Format
|
|
pool:
|
|
vmImage: 'ubuntu-18.04'
|
|
container: snmallocciteam/build_linux_x64:latest
|
|
steps:
|
|
- script: |
|
|
mkdir build
|
|
cd build
|
|
cmake -GNinja ..
|
|
|
|
env:
|
|
CC: /usr/bin/gcc-8
|
|
CXX: /usr/bin/g++-8
|
|
|
|
- script: |
|
|
set -eo pipefail
|
|
ninja clangformat
|
|
git diff --exit-code $(Build.SourceVersion)
|
|
|
|
workingDirectory: build
|
|
failOnStderr: true
|
|
displayName: 'Clang-Format'
|
|
|
|
- script: |
|
|
set -eo pipefail
|
|
clang-tidy-9 src/override/malloc.cc -header-filter="`pwd`/*" -warnings-as-errors='*' -export-fixes=tidy.fail -- -std=c++17 -mcx16
|
|
|
|
displayName: 'Clang-Tidy'
|