Bug #117358 All clone tests fail to shutdown server under Valgrind
Submitted: 31 Jan 14:53 Modified: 26 Feb 14:44
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Clone Plugin Severity:S7 (Test Cases)
Version:9.2.0 OS:Ubuntu (22.04.5)
Assigned to: CPU Architecture:x86

[31 Jan 14:53] Laurynas Biveinis
Description:
Running any clone test results in "Command "shutdown_server" failed with error 2. my_errno=175"

For example,
./mtr clone.local_basic
...
==335470== 
mysqltest: At line 101: Command "shutdown_server" failed with error 2. my_errno=175.
In included file ./include/restart_mysqld.inc: 102
included from /home/laurynas/vilniusdb/mysql-9.2.0/mysql-test/suite/clone/t/local_basic.test: 115

The result from queries just before the failure was:
...
# restart: --datadir=CLONE_DATADIR

Note that the output will show one Valgrind error with do_shutdown_server in mysqltest.cc - this is NOT what this bug report is about. The mysqltest memory leak has been here forever and is not related to this issue.

How to repeat:
Server built with -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=ON -DWITH_SYSTEM_LIBS=ON -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DFORCE_COLORED_OUTPUT=ON -DCMAKE_CXX_FLAGS=-g -Wno-documentation -DCMAKE_CXX_FLAGS_DEBUG=-g -Wno-documentation -DCMAKE_CXX_FLAGS_RELEASE=-g -O2 -DNDEBUG -Wno-documentation -DWITH_VALGRIND=ON
[31 Jan 15:37] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback.

regards,
Umesh
[11 Feb 14:07] MySQL Verification Team
Hello Laurynas,

I had verified this once but couldn't save the test results at that time(messed with VM for another bug and ended up corrupting) but when I'm trying now to reproduce this issue it is not failing. Is there anything I'm missing here? Please let us know. Thank you.

-- Env

 cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

-- build

MYSQL_VERSION="Bug117358"
TARGET=/home/umshastr/src/mysql-9.2.0/$MYSQL_VERSION
rm -rf /home/umshastr/src/mysql-9.2.0/$MYSQL_VERSION
rm -rf bld/
mkdir bld && cd bld
rm -rf CMakeCache.txt

cmake .. -DCMAKE_INSTALL_PREFIX=$TARGET -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=ON -DWITH_SYSTEM_LIBS=ON -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DFORCE_COLORED_OUTPUT=ON -DCMAKE_CXX_FLAGS='-g -Wno-documentation' -DCMAKE_CXX_FLAGS_DEBUG='-g -Wno-documentation' -DCMAKE_CXX_FLAGS_RELEASE='-g -O2 -DNDEBUG -Wno-documentation' -DWITH_VALGRIND=ON -G Ninja

ninja -j16
ninja install

--mtr

./mtr clone.local_basic --valgrind
Logging: ./mtr  clone.local_basic --valgrind
MySQL Version 9.2.0
Turning on valgrind for all executables
Running valgrind with options " --tool=memcheck --num-callers=16 --show-reachable=yes --suppressions=/home/umshastr/src/mysql-9.2.0/Bug117358/mysql-test/valgrind.supp "
Turning off --check-testcases to save time when valgrinding
Checking supported features
 - Binaries are debug compiled
Using 'all' suites
Collecting tests
Checking leftover processes
Removing old var directory
.
.
==============================================================================
                  TEST NAME                       RESULT  TIME (ms) COMMENT
------------------------------------------------------------------------------
[ 33%] clone.local_basic                         [ pass ]  1005862
[ 66%] shutdown_report                           [ pass ]
[100%] valgrind_report                           [ pass ]
------------------------------------------------------------------------------
The servers were restarted 0 times
The servers were reinitialized 0 times
Spent 1005.862 of 1326 seconds executing testcases

Completed: All 3 tests were successful.

regards,
Umesh
[26 Feb 14:14] Laurynas Biveinis
I can reproduce this on one machine and not another. Perhaps that machine is just too slow, let's close this one and I'll reopen if needed
[26 Feb 14:44] MySQL Verification Team
Thank you, Laurynas.
For now will close this report as you suggested but please feel free to reopen if needed. 

Sincerely,
Umesh