Il y a quelque jours j’ai dû dépanner un serveur tournant sous la distribution Gentoo OVH R2. La cause ? Le daemon MySQLd s’arrêtait (crash) régulièrement après quelques minutes aléatoires et avec pour seul message d’erreur dans les logs :
130327 13:09:32 - 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.thd=0xc23dd0
Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... Cannot determine thread, fp=0x41639068, backtrace may not be correct. Stack range sanity check OK, backtrace follows: 0x6c2d34342e302e35 New value of fp=0xc23dd0 failed sanity check, terminating stack trace! Please read http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and follow instructions on how to resolve the stack trace. Resolved stack trace is much more helpful in diagnosing the problem, so please do resolve it Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0xc55340 = INSERT IGNORE INTO `test`.php_index_dico (hash, dico) VALUES (0xd27edbd18c3bdf9c,'sites'),(0xbfe956f1134be5a8,'cat1'),(0x15a48c9b90862a4f,'cat2'),(0x47a282dfe68a42d3,'cat3'),(0x8275a1889c0a4b12,'cat4'),...,etc. thd->thread_id=138 The manual page at http://www.mysql.com/doc/en/Crashing.html contains information that should help you find out what is causing the crash.
J’ai passé mal de temps à chercher ce qui pouvait provoquer ce phénomène dont voici une petite liste exhaustive des causes possibles à retenir :
- Une partition occupée à 100%.
- Un bug de MySQL ou d’une lib associé.
- Le Kernel GRSEC OVH. (netboot)
- L’utilisation d’InnoDB qui est fortement déconseillé sous Gentoo OVH.
- Un problème hardware. (cf. mysqld got signal 11)
- Un bordel invisible dans la BDD…
Dans mon cas il s’agissait bien « D’un bordel invisible dans la BDD. »
Pour une raison que j’ignore ma BDD « test » provoquait le crash de MySQL. J’ai bien essayé via PhpMyAdmin de réparer, optimiser, analyser, etc la BDD « test » en vain, puisque celui-ci m’affichait que tout était « OK ».
Pour résoudre le problème : j’ai donc exporté la BDD, supprimé (avec l’utilisateur associé), re-crée la BDD, re-importé les données.
Depuis, ça re-marche au poil.