inside the mind of a linux admin

mod_python failing to compile due to bug in connobject.c

I recently recompiled PHP on a server I own to upgrade it to the latest version. This particular server runs cPanel, which usually makes this otherwise tedious process much simpler. However, when recompiling mod_python it errors out with this message:

touch connobject.slo connobject.c: In function '_conn_read':
connobject.c:142: error: request for member 'next' in something not a structure or union
apxs:Error: Command failed with rc=65536
make[1]: *** [mod_python.so] Error 1

The entire process then fails and reverts itself to the last known working LAMP stack.

The problem is actually a known bug, and is fixable with a bit of hackery. If you are not using a cPanel server, it’s very easy. Just simple change one line at your leisure prior to compiling.

If you are using a cPanel server, you need to time the patch correctly. Let me elaborate.

First, the bug itself is in connobject.c on line 142.

To fix, simply replace:

!(b == APR_BRIGADE_SENTINEL(b) ||

with

!(b == APR_BRIGADE_SENTINEL(bb) ||

Simple enough.

Now, back to cPanel. Since easy apache will download fresh copies of the source upon each build session, you need to apply the fix strategically AFTER it downloads the fresh copy, but BEFORE it attempts to compile it. There is a window of approximately 1-2 minutes to do this, depending on the speed of your server.

Here’s a trick that I used to make sure I’m catching it.

First before starting the build, remove the file entirely

# rm -f /home/cpeasyapache/src/mod_python-3.3.1/src/connobject.c

Second, start the build process.

Now, do a simple while loop or just manually check for the file periodically. Once it appears, you know you’re working with the fresh copy from the build and can perform your edit on line 142.

# while true ; do ls /home/cpeasyapache/src/mod_python-3.3.1/src/connobject.c ; sleep 5; done

Once you’ve edited the buggy line, save the file, sit back and wait for the build to complete (successfully).

Hope this helped!



Bug reported at:
http://trac.macports.org/ticket/15791
http://bugs.gentoo.org/show_bug.cgi?id=230211

Related Posts

How to install CSF Firewall on CentOS 7

ConfigServer (CSF) is advanced open-source firewall for Linux. If you are like me, I don’t really care much for the native firewalld that’s included with RHEL7 releases, and I’ve used APF for years which is basically just a frontend for iptables. Here’s instructions on how to install it: 1. Disable firewalld systemctl stop firewalld systemctl […]

Read More

ScreenCloud: Troubleshooting missing Python modules after updates

One of my favorite tools that I find myself using quite often is called “ScreenCloud“. It allows you to quickly select any area of your workspace, create an sized screen shot, and then upload it or export it off to their server, your Dropbox account or an SFTP server. If you’ve recently performed upgrades, either […]

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

Twitter: kireguy

Tweeter button Facebook button Myspace button