Bug #113703 Test innodb.ddl_kill fails under Sanitizer build
Submitted: 22 Jan 11:10 Modified: 4 Jul 8:34
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:8.4, 9.0. OS:MacOS (12.4.1)
Assigned to: CPU Architecture:ARM

[22 Jan 11:10] Laurynas Biveinis
Description:
If the server is compiled with sanitizer options, then the innodb.ddl_kill fails:
...
CURRENT_TEST: innodb.ddl_kill
mysqltest: At line 60: Query 'reap' succeeded, should have failed with error '1317'

The result from queries just before the failure was:
SET SESSION DEBUG='+d,ddl_merge_sort_interrupt';
SET DEBUG_SYNC='ddl_merge_sort_interrupt SIGNAL ready WAIT_FOR interrupt';
ALTER TABLE t ADD PRIMARY KEY(c);;
# default: Kill the DDL
SET DEBUG_SYNC='now WAIT_FOR ready';
KILL QUERY @id;
SET DEBUG_SYNC='now SIGNAL interrupt';
# con1: reap
ERROR 70100: Query execution was interrupted
# con2: Start the DDL
SET SESSION DEBUG='+d,ddl_btree_build_interrupt';
SET DEBUG_SYNC='ddl_btree_build_interrupt SIGNAL ready WAIT_FOR interrupt';
ALTER TABLE t ADD index i(c);;
# default: Kill the DDL
SET DEBUG_SYNC='now WAIT_FOR ready';
Warnings:
Warning	1639	debug sync point wait timed out
KILL QUERY @id;
SET DEBUG_SYNC='now SIGNAL interrupt';
# con2: reap
safe_process[46873]: Child process: 46874, exit: 1
...

How to repeat:
The CMake options I used for build were
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=ON -DDOWNLOAD_BOOST=ON -DWITH_BOOST=~/vilniusdb/mysql-boost/ -DWITH_SYSTEM_LIBS=ON -DFORCE_COLORED_OUTPUT=ON -DCMAKE_C_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-O2 -g -DNDEBUG -Wno-unused-variable -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_UBSAN=ON
[22 Jan 11:43] MySQL Verification Team
Hi Mr. Laurynas,

Thank you for your bug report.

However, we need more feedback from you in order to attempt to repeat this bug.

Please, provide us with all details of the environment in which your test were run, the exact CPUs that you use and the full description of the CMAKE and CC and CXX options that you used in order to get the tests fail. Also, did you use options for the Debug or Release versions and which ones exactly ????

There is another problem with your report.  The error that you get has NOTHING to do with sanitizer itself.

This is not the message from the sanitizer, but from the test suite itself.

Hence, can you repeat this error with DEBUG build, with no Sanitizer built in ????

You could also try to repeat the error with our own mysqld debug binary which comes with our macOS packages . Do you get the failed test there too ????

We are waiting for your full and detailed feedback.

Thanks in advance.
[23 Jan 10:13] Laurynas Biveinis
Dear MySQL Verification Team,

1) macOS 12.4.1 on an M1 Max CPU. The CMake flags have been provided in the original report. No other CC/CXX options have been set. The "Debug or Release" question is answered there too (it's Debug).
2) I never claimed that the the test fail with a sanitizer error. What I did claim was, that the server build with sanitizer options fails the testcase. The server built with the same options but excluding the sanitizer flags does not fail the testcase.
3) Since the debug server does not fail the testcase and only adding the sanitizer flags makes it do so, I will not try any other binaries because there is nothing to try unless you have sanitizer-enabled binaries, which I doubt.
[23 Jan 11:30] MySQL Verification Team
Hi Mr. Biveinis,

Of course that we have sanitizer-enabled binaries and we have informed you previously of the results of those.

Also, let us know whether are you aware that these tests pass or fail with 8.0.35.

Last, but not least,  looking at your entries for "CPU Architecture", we understand that those fail on both CPU's supported by macOS in question

Looking forward to your feedback.
[23 Jan 11:36] Laurynas Biveinis
Sorry, I meant sanitizer binaries for download.
[23 Jan 11:43] MySQL Verification Team
Hi,

You answered the question about the CPU.

Let us conclude that you have not managed to repeat this problem on 8.0.35. Are we correct.

We have found a way to get access on Mac mini on M1 and started building debug binary with sanitizer settings.
[23 Jan 12:02] Laurynas Biveinis
I am sorry for a partial reply before. Indeed I set the CPU architecture to ARM because I tested there.

8.0.35 fails in the same way:
...
MySQL Version 8.0.35
...
[ 50%] innodb.ddl_kill                           [ fail ]
        Test ended at 2024-01-23 14:00:35

CURRENT_TEST: innodb.ddl_kill
mysqltest: At line 60: Query 'reap' succeeded, should have failed with error '1317'

The result from queries just before the failure was:
SET SESSION DEBUG='+d,ddl_merge_sort_interrupt';
SET DEBUG_SYNC='ddl_merge_sort_interrupt SIGNAL ready WAIT_FOR interrupt';
ALTER TABLE t ADD PRIMARY KEY(c);;
# default: Kill the DDL
SET DEBUG_SYNC='now WAIT_FOR ready';
KILL QUERY @id;
SET DEBUG_SYNC='now SIGNAL interrupt';
# con1: reap
ERROR 70100: Query execution was interrupted
# con2: Start the DDL
SET SESSION DEBUG='+d,ddl_btree_build_interrupt';
SET DEBUG_SYNC='ddl_btree_build_interrupt SIGNAL ready WAIT_FOR interrupt';
ALTER TABLE t ADD index i(c);;
# default: Kill the DDL
SET DEBUG_SYNC='now WAIT_FOR ready';
Warnings:
Warning	1639	debug sync point wait timed out
KILL QUERY @id;
SET DEBUG_SYNC='now SIGNAL interrupt';
# con2: reap
safe_process[77398]: Child process: 77399, exit: 1
[23 Jan 12:53] MySQL Verification Team
Hi Mr. Biveinis,

We have finally managed to build 8.0.36 debug binaries on Sonoma running on M2.

We did not manage to repeat the test failure on x86, but this test failed, as you reported, on Sonoma running on M2.

This bug is now verified for the specified platform only.

Thank you for your contribution.
[23 Jan 12:56] MySQL Verification Team
HI,

A small addition.

Debug binaries were built with all sanitizer options.
[6 May 5:21] Laurynas Biveinis
On 8.0.37, the test fails under debug build without sanitizer options too, with the same output
[9 May 9:30] MySQL Verification Team
Hi Mr. Biveinis,

We confirm your results and we add it to the internal database.
[4 Jul 8:34] Laurynas Biveinis
Did not reproduce on 8.0.38
Reproduced on 8.4.1 and 9.0.0
[4 Jul 9:35] MySQL Verification Team
Hi Mr. Biveinis,

Thank you for your feedback.

Since it is fixed in 8.0.38, that means that version 8.0 is no longer affected.

Hence, the change in the version .........