misc: fix dangling pointer in printf_buffer #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Linux / CPU x86-64 tests | |
permissions: | |
contents: read | |
on: | |
push: | |
workflow_dispatch: | |
pull_request: | |
paths-ignore: | |
- 'doc/**' | |
- 'CHANGES' | |
- 'COPYING' | |
- 'CREDITS' | |
- 'LICENSE' | |
- 'README.*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CCACHE_BASEDIR: "${{ github.workspace }}" | |
CCACHE_DIR: "${{ github.workspace }}/../../../../ccache_storage" | |
EXAMPLES_DIR: "${{ github.workspace }}/../../../../examples" | |
jobs: | |
main_test_matrix: | |
name: LLVM ${{ matrix.llvm }} - ${{ matrix.config }} | |
runs-on: [self-hosted, linux, x64, "${{ matrix.config }}" ] | |
# CPU runners have action runner directly in the home directory | |
env: | |
CCACHE_BASEDIR: "${{ github.workspace }}" | |
CCACHE_DIR: "${{ github.workspace }}/../../../ccache_storage" | |
EXAMPLES_DIR: "${{ github.workspace }}/../../../examples" | |
TSAN_OPTIONS: "second_deadlock_stack=1" | |
strategy: | |
fail-fast: false | |
matrix: | |
llvm: [17, 18] | |
# basic = simplest pthread build | |
# devel = with devel options | |
# cts_spirv = cts with SPIR-V | |
# tier1 = includes CTS without SPIR-V | |
# asan, tsan, ubsan = sanitizers | |
# chipstar 1.1 only supports LLVM up to 17 | |
config: [cts_spirv, tier1, chipstar, asan, tsan, ubsan] | |
exclude: | |
- llvm: 18 | |
config: chipstar | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
- name: Load Env vars | |
id: load-env | |
run: | | |
cat ${{ github.workspace }}/.github/variables.txt >> $GITHUB_ENV | |
- name: CMake | |
id: cmake | |
run: | | |
runCMake() { | |
BUILD_FLAGS="-O1 -ggdb -march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable" | |
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DDEVELOPER_MODE=ON \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo "-DCMAKE_C_FLAGS_RELWITHDEBINFO=$BUILD_FLAGS" \ | |
"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$BUILD_FLAGS" \ | |
-DWITH_LLVM_CONFIG=/usr/bin/llvm-config-${{ matrix.llvm }} -DLLVM_SPIRV=/usr/bin/llvm-spirv-${{ matrix.llvm }} \ | |
"$@" -B ${{ github.workspace }}/build ${{ github.workspace }} | |
} | |
rm -rf ${{ github.workspace }}/build | |
mkdir ${{ github.workspace }}/build | |
if [ "${{ matrix.config }}" == "cts_spirv" ]; then | |
mkdir -p ${EXAMPLES_DIR}/build_cts_spirv | |
mkdir -p ${EXAMPLES_DIR}/source | |
runCMake -DENABLE_TESTSUITES=conformance -DENABLE_CONFORMANCE=ON -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_cts_spirv | |
elif [ "${{ matrix.config }}" == "tier1" ]; then | |
mkdir -p ${EXAMPLES_DIR}/build_tier1 | |
runCMake "-DENABLE_TESTSUITES=AMDSDK3.0;piglit;conformance;PyOpenCL;IntelSVM" -DENABLE_CONFORMANCE=ON -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_tier1 | |
elif [ "${{ matrix.config }}" == "chipstar" ]; then | |
mkdir -p ${EXAMPLES_DIR}/build_chipstar_${{ matrix.llvm }} | |
mkdir -p ${EXAMPLES_DIR}/source | |
runCMake -DENABLE_TESTSUITES=chipStar -DTESTSUITE_SOURCE_BASEDIR=${EXAMPLES_DIR}/source -DTESTSUITE_BASEDIR=${EXAMPLES_DIR}/build_chipstar_${{ matrix.llvm }} | |
elif [ "${{ matrix.config }}" == "asan" ]; then | |
runCMake -DENABLE_ASAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DDEVELOPER_MODE=OFF | |
elif [ "${{ matrix.config }}" == "tsan" ]; then | |
runCMake -DENABLE_TSAN=1 -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 -DENABLE_PRINTF_IMMEDIATE_FLUSH=OFF | |
elif [ "${{ matrix.config }}" == "ubsan" ]; then | |
runCMake -DENABLE_UBSAN=1 -DENABLE_LATEST_CXX_STD=ON -DENABLE_ICD=0 -DENABLE_LOADABLE_DRIVERS=0 | |
else | |
echo "Unknown configuration" && exit 1 | |
fi | |
- name: Build PoCL | |
id: build_pocl | |
timeout-minutes: 30 | |
run: | | |
cd ${{ github.workspace }}/build && make -j$(nproc) | |
- name: Build CTS Examples | |
id: build_cts_examples | |
# occasionally git timeouts on git clone of the examples | |
timeout-minutes: 60 | |
if: ${{ matrix.config == 'cts_spirv' || matrix.config == 'tier1' }} | |
run: | | |
cd ${{ github.workspace }}/build/examples/conformance && make -j$(nproc) conformance | |
- name: Build Tier1 Examples | |
id: build_tier1_examples | |
# occasionally git timeouts on git clone of the examples | |
timeout-minutes: 90 | |
if: ${{ matrix.config == 'tier1' }} | |
run: | | |
cd ${{ github.workspace }}/build/examples/AMDSDK3.0 && make -j$(nproc) AMDSDK3.0 | |
cd ${{ github.workspace }}/build/examples/piglit && make -j$(nproc) piglit | |
# currently broken | |
#cd ${{ github.workspace }}/build/examples/PyOpenCL && make -j$(nproc) PyOpenCL | |
cd ${{ github.workspace }}/build/examples/IntelSVM && make -j$(nproc) IntelSVM | |
- name: Build chipStar Examples | |
id: build_chipstar_examples | |
# occasionally git timeouts on git clone of the examples | |
timeout-minutes: 90 | |
if: ${{ matrix.config == 'chipstar' }} | |
run: | | |
cd ${{ github.workspace }}/build/examples/chipStar && make -j$(nproc) chipStar | |
- name: Get CMake version | |
id: cmake_version | |
run: echo "version=$(cmake --version | head -n 1)" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Cache CTest timings | |
id: cache_ctest | |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a | |
with: | |
path: ${{ github.workspace }}/build/Testing/Temporary/CTestCostData.txt | |
key: ctest-cache-${{ steps.cmake_version.outputs.version }}-${{ runner.name }}-${{ matrix.config }} | |
- name: Run Tests | |
env: | |
POCL_CACHE_DIR: "${{ runner.temp }}/GH_POCL_CACHE" | |
id: ctest | |
timeout-minutes: 120 | |
run: | | |
runCTest() { | |
cd ${{ github.workspace }}/build && ctest -j$(nproc) $CTEST_FLAGS "$@" | |
} | |
rm -rf ${{ env.POCL_CACHE_DIR }} | |
mkdir ${{ env.POCL_CACHE_DIR }} | |
if [ "${{ matrix.config }}" == "cts_spirv" ]; then | |
runCTest -L conformance_suite_micro_spirv | |
elif [ "${{ matrix.config }}" == "tier1" ]; then | |
runCTest -L "amdsdk_30|piglit|PyOpenCL|conformance_suite_micro_main|IntelSVM" | |
elif [ "${{ matrix.config }}" == "chipstar" ]; then | |
runCTest -L chipStar | |
elif [ "${{ matrix.config }}" == "asan" ]; then | |
runCTest -L "runtime|asan" | |
elif [ "${{ matrix.config }}" == "tsan" ]; then | |
runCTest -L "internal|tsan" -E "clCreateSubDevices" | |
elif [ "${{ matrix.config }}" == "ubsan" ]; then | |
runCTest -L "internal|ubsan" | |
else | |
echo "Unknown configuration" && exit 1 | |
fi | |