Midgard and Ubuntu and segfaults
Posted on 2007-10-25 22:43:53 EEST.
Few days ago, Andreas reported segfaults on Ubuntu. Today I built ubuntu getsy packages for latest Midgard and was surprised when I saw "Segmentation Fault" in apache's error log file. Just after I made first request.
Hold on, this is Midgard 1.8 stable release. I know how it's designed and written and in most cases it's the last part of software I could blame for acting up on my ( on any ) server. A bit shameless, but true.
Gdb and newly written test script clearly pointed to dba_open which I started to blame a bit earlier, and just few minutes ago I found this bug report.
I must check if db4 upgrade can help.
Updated (2007-10-26): There are two ways to fix an issue. One is to update MidCOM from trunk, as this version doesn't use php dba functionality. Seems to be easiest but not recommended for production server , especially when you are not midcom developer.
Another solution is to rebuild php packages with flatfile dba support. To make this just download php5 source packages:
apt-get source php5
cd php5-5.2.3
Add --with-flatfile ( debian/rules ) to COMMON_CONFIG.
dpkg-buildpackage -b
Then, install php5-cli and libapache2-mod-php5. Update midcom code ( in file: /usr/share/php/midcom/lib/midcom/services/cache/backend/dba.php ) :
if (in_array('db4', $handlers))
{
$this->_handler = 'flatfile';
}
I know it's not best solution but the quickest I found as temporary solution before ubuntu maintainers will update php and dba packages.