Segfaults when using postfix with MariaDB or Percona

By on January 15, 2013 - Geekery

I ran into a weird problem where postfix suddenly started segfaulting on me just after upgrading it to the latest version.

Jan 15 03:28:41 geode kernel: smtpd[8569]: segfault at c9 ip 00007fcff5fa8469 sp 00007fffe88163d0 error 4 in[7fcff5ec8000+174000]

Debugging with strace showed me that the segfault happened just after attempting a MySQL query. Google tells me that people are having the same problem with Percona libraries too, although they didn’t figure out the answer. I’ll save you the story of all the debugging, but it turns out that if you install MariaDB-devel, then you must also install MariaDB-shared or programs that you compile will segfault. It is likely the same answer for Percona.

No, I don’t know why. It’s a bit late for debugging.

$ sudo yum install MariaDB-shared --enablerepo=mariadb
Running Transaction
  Installing : MariaDB-shared-5.5.28a-1.x86_64                                                       1/1 
  Verifying  : MariaDB-shared-5.5.28a-1.x86_64                                                       1/1 

  MariaDB-shared.x86_64 0:5.5.28a-1