SIGSEGVを受け取った時刻がログに出力されるようになる

これまでmysqldはSIGSEGVを受け取った際、エラーログにいろいろ書き出すようになっていましたが、受け取り時刻については出力していませんでした。というかこれ、気づいてなかった(^^; 無いと困るよねぇ〜。

以下は ps して調べた pid を使って kill -11 した際の現行のログ出力。

mir@t43:/usr/local/mysql/bin$ ./mysqld
070220 10:01:54  InnoDB: Started; log sequence number 0 49439
070220 10:01:54 [Note] ./mysqld: ready for connections.
Version: '5.1.14-beta'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
070220 10:01:54 [Note] SCHEDULER: Loaded 0 events
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
...(以下略)...

この赤字の部分に、シグナル受信時刻があわせて今後は出力されるようになります。

以下はパッチ抜粋。

   fprintf(stderr,"\
-mysqld got signal %d;\n\
+%02d%02d%02d %2d:%02d:%02d - mysqld got signal %d;\n\
 This could be because you hit a bug. It is also possible that this binary\n\
 or one of the libraries it was linked against is corrupt, improperly built,\n\
 or misconfigured. This error can also be caused by malfunctioning hardware.\n",
+          tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday,
+          tm.tm_hour, tm.tm_min, tm.tm_sec,
 	  sig);
   fprintf(stderr, "\
 We will try our best to scrape up some info that will hopefully help diagnose\n\

関連ページ