Skip to content

Commit d544194

Browse files
PS-10014 feature: Add Valgrind testing to the CI
https://perconadev.atlassian.net/browse/PS-10014 Added new step to GitHub Actions. We now run MTR under Valgrind for "GCC 14 Debug" configuration.
1 parent 4d73e97 commit d544194

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
name: "GCC 14 Debug",
6868
label: "debug_gcc14",
6969
run_mtr: true,
70+
run_valgrind_mtr: true,
7071
run_ctest: true
7172
}
7273
- {
@@ -136,8 +137,13 @@ jobs:
136137
run: |
137138
sudo apt-get install g++-14
138139
140+
- name: Install Valgrind on ubuntu
141+
if: matrix.config.run_valgrind_mtr
142+
run: |
143+
sudo apt-get install valgrind
144+
139145
- name: Fixing libaio1 for MySQL Server tarball
140-
if: matrix.config.run_mtr
146+
if: matrix.config.run_mtr || matrix.config.run_valgrind_mtr
141147
run: |
142148
sudo apt-get install libaio-dev
143149
sudo ln -s libaio.so /lib/x86_64-linux-gnu/libaio.so.1
@@ -249,15 +255,16 @@ jobs:
249255
run: run-clang-tidy-20 -header-filter=.* -j=${{steps.cpu-cores.outputs.count}} -use-color -p=${{github.workspace}}/src-build-${{matrix.config.label}}
250256

251257
- name: Application version
258+
if: false
252259
working-directory: ${{github.workspace}}/src-build-${{matrix.config.label}}
253260
run: ./binlog_server version
254261

255262
- name: Creating DIST directory for MySQL Server tarballs
256-
if: matrix.config.run_mtr
263+
if: matrix.config.run_mtr || matrix.config.run_valgrind_mtr
257264
run: mkdir -p ${{github.workspace}}/dist
258265

259266
- name: Unpacking MySQL Server 8.0 tarballs
260-
if: matrix.config.run_mtr
267+
if: matrix.config.run_mtr || matrix.config.run_valgrind_mtr
261268
working-directory: ${{github.workspace}}/dist
262269
run: |
263270
# https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.45-linux-glibc2.28-x86_64.tar.xz
@@ -276,7 +283,7 @@ jobs:
276283
./${DIST_BASE_NAME}/bin/mysqld --version
277284
278285
- name: Unpacking MySQL Server 8.4 tarballs
279-
if: matrix.config.run_mtr
286+
if: matrix.config.run_mtr || matrix.config.run_valgrind_mtr
280287
working-directory: ${{github.workspace}}/dist
281288
run: |
282289
# https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-8.4.8-linux-glibc2.28-x86_64-minimal.tar.xz
@@ -303,6 +310,15 @@ jobs:
303310
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --repeat=2 --parallel=${{steps.cpu-cores.outputs.count}} \
304311
--suite=binlog_streaming ${{matrix.config.mtr_options}}
305312
313+
- name: MTR 8.0 tests (Valgrind)
314+
if: matrix.config.run_valgrind_mtr
315+
working-directory: ${{github.workspace}}/dist/${{format('mysql-{0}-{1}', env.MYSQL_80_VERSION, env.MYSQL_GLIBC_SUFFIX)}}/mysql-test
316+
run: |
317+
BINSRV=${{github.workspace}}/src-build-${{matrix.config.label}}/binlog_server ./mtr \
318+
--vardir=${{runner.temp}}/mtrvardir80 \
319+
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --parallel=${{steps.cpu-cores.outputs.count}} \
320+
--suite=binlog_streaming --valgrind
321+
306322
- name: MTR 8.4 tests
307323
if: matrix.config.run_mtr
308324
working-directory: ${{github.workspace}}/dist/${{format('mysql-{0}-{1}-minimal', env.MYSQL_84_VERSION, env.MYSQL_GLIBC_SUFFIX)}}/mysql-test
@@ -312,6 +328,15 @@ jobs:
312328
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --repeat=2 --parallel=${{steps.cpu-cores.outputs.count}} \
313329
--suite=binlog_streaming ${{matrix.config.mtr_options}}
314330
331+
- name: MTR 8.4 tests (Valgrind)
332+
if: matrix.config.run_valgrind_mtr
333+
working-directory: ${{github.workspace}}/dist/${{format('mysql-{0}-{1}-minimal', env.MYSQL_84_VERSION, env.MYSQL_GLIBC_SUFFIX)}}/mysql-test
334+
run: |
335+
BINSRV=${{github.workspace}}/src-build-${{matrix.config.label}}/binlog_server ./mtr \
336+
--vardir=${{runner.temp}}/mtrvardir84 \
337+
--force --max-test-fail=0 --retry=0 --nounit-tests --big-test --parallel=${{steps.cpu-cores.outputs.count}} \
338+
--suite=binlog_streaming --valgrind
339+
315340
- name: CTest
316341
if: matrix.config.run_ctest
317342
working-directory: ${{github.workspace}}/src-build-${{matrix.config.label}}

src/app.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,13 @@ extern "C" void custom_signal_handler(int /*signo*/) {
10601060
int main(int argc, char *argv[]) {
10611061
using namespace std::string_literals;
10621062

1063+
[[maybe_unused]] auto *ptr{new std::byte[1024]};
1064+
ptr[512] = static_cast<std::byte>(42U);
1065+
std::function<void(std::byte *)> deleter{
1066+
[](auto *pointer) { delete[] pointer; }};
1067+
deleter(ptr);
1068+
deleter(ptr);
1069+
10631070
const auto cmd_args = util::to_command_line_agg_view(argc, argv);
10641071
const auto executable_name = util::extract_executable_name(cmd_args);
10651072

0 commit comments

Comments
 (0)