[MDEV-20694] Tests on GCOV build fail with Merge mismatch for function Created: 2019-09-28 Updated: 2022-10-18 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Tests |
| Affects Version/s: | 5.5, 10.1, 10.2, 10.3, 10.4, 10.6 |
| Fix Version/s: | 10.4, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 ; also observed on Xenial with gcc 5.4.0 and 7.4.0 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
To reproduce:
Soon enough, the test run fails with
The archive contents is very simple, it's just added as a tarball for convenience. There are two test files in it, a cnf file for the first test, and result files for both:
The second test is derived from main.mysqld--defaults-file. The first one can be anything, as long as it requires two servers. It is not the only unique way to reproduce the problem. Here is another one, for example. gcov1 test is the same one as above:
The first test run passes, there are no errors. But the second one produces the errors already on the bootstrap:
Reproducible on all of current 5.5-10.4. I didn't try 10.5, but I don't expect any difference. |
| Comments |
| Comment by Marko Mäkelä [ 2022-04-19 ] | ||||||||||||||||||||||||||||
|
The errors are of the following type (using GCC 12):
| ||||||||||||||||||||||||||||
| Comment by Anel Husakovic [ 2022-04-19 ] | ||||||||||||||||||||||||||||
|
Hi marko can you test with this patch https://jira.mariadb.org/browse/MDEV-26102 ? | ||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-04-19 ] | ||||||||||||||||||||||||||||
|
anel, as far as I can tell, Something in the code that is being exercised by those 3 tests seems to be incompatible with the code generated or linked by the GCC option --coverage. I do not know if it is related, but I also got wrongly claimed non-coverage of an error message that is being suppressed and was being emitted during the execution of the test innodb.instant_alter_import. After the message was output, the server was shut down and restarted according to the logs.
I hadn’t used gcov for years, and I am not familiar with its implementation, so I am only a dummy messenger here. | ||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-04-23 ] | ||||||||||||||||||||||||||||
|
My claim about a bogus non-coverage report may be incorrect. There are two code snippets where the message that innodb.instant_alter_import would trigger is output, and only one of them is covered by the test. As reported in MDEV-28394, I made an experiment with the coverage tool built in clang. The sancov tool to aggregate data from per-process trace files turned out to be unusable. It would run single-threaded. When invoked on too many files, it would allocate about 1 gigabyte of RAM per minute, until finally running out of RAM. I am rather convinced that with any profiling tool, profiling data will normally be lost for executions that involve killing a process. Should this be a problem with the few mtr tests that involve killing the database server process, this could be worked around by duplicating some of the test logic so that the test steps would be followed by a normal process termination. | ||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2022-10-18 ] | ||||||||||||||||||||||||||||
|
Note: When compiling with GCC 11 or later, some changes to the code will be needed:
|