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

synergy: How to enable crypto (encryption) and generate SSL certificate

The newer Linux versions of the popular mouse/keyboard sharing application “synergy” now has built in encryption. Here’s how to configure it: Just simply passing the –enable-crypto flag on your synergy server without having a proper SSL certificate will result in the inability to connect to clients and generate an error message similar to this in […]

Read More

Change Number Pad Delete (dot) key from a comma in Ubuntu Linux

I recently purchased a new keyboard and updated to the latest Ubuntu, I’m also an avid user of the number pad for quick input when dealing with spreadsheets or accounting. I found that my num pad’s delete key (“.”) was outputting a comma (“,”) instead. Pretty annoying? I agree, but this can be very easily […]

Read More

Leave a Reply

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

Twitter: kireguy

Tweeter button Facebook button Myspace button