Bug #29543 GCov information not written in case of crash
Submitted: 4 Jul 2007 8:55 Modified: 7 Jul 2007 19:06
Reporter: Kristian Nielsen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:Any
Assigned to: Kristian Nielsen CPU Architecture:Any

[4 Jul 2007 8:55] Kristian Nielsen
Description:
The BUILD/compile-pentium-gcov build script can be used to provide test coverage analysis using GCC and GCov.

A problem arises when the mysqld server crashes during tests. In this case, the server will exit before the information required by GCov can be written to disk. This causes GCov reports to be misleading.

How to repeat:
Run a test that crashes the mysqld server, and check gcov output afterwards.

Suggested fix:
In the write_core() function, call the GCC internal __gcov_flush() function just before crashing, to make sure coverage output is written.

I will submit a patch for this.
[7 Jul 2007 6:15] Kristian Nielsen
Pushed to mysql-5.0-engines and mysql-5.1-engines.
[7 Jul 2007 16:35] Bugs System
Pushed into 5.0.46
[7 Jul 2007 16:52] Bugs System
Pushed into 5.1.21-beta
[7 Jul 2007 19:06] Paul DuBois
Noted in 5.0.46, 5.1.21 changelogs.

gcov coverage-testing information was not written if the server crashed.
[7 Jul 2007 19:47] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/30483

ChangeSet@1.2519, 2007-07-07 07:46:17+02:00, knielsen@ymer.(none) +2 -0
  Bug #29543 GCov information not written in case of crash.
  
  For GCov builds, if the server crashes, the normal exit handler for writing
  coverage information is not executed due to the abnormal termination.
  
  Fix this by explicitly calling the __gcov_flush function in our crash handler.