1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
unknown
2007-07-07 07:46:17 +02:00
parent b1dce946cc
commit 87e1a302c3
2 changed files with 12 additions and 2 deletions

View File

@ -241,6 +241,15 @@ void write_core(int sig)
void write_core(int sig)
{
signal(sig, SIG_DFL);
#ifdef HAVE_gcov
/*
For GCOV build, crashing will prevent the writing of code coverage
information from this process, causing gcov output to be incomplete.
So we force the writing of coverage information here before terminating.
*/
extern void __gcov_flush(void);
__gcov_flush();
#endif
pthread_kill(pthread_self(), sig);
#if defined(P_MYID) && !defined(SCO)
/* On Solaris, the above kill is not enough */