tags:

views:

62

answers:

2

Playing around with this a bit, but not getting too far...

The logic of my SQLite code works if I compile it as a stand-alone executable.

My mod_hello.c compiles and loads/works fine without the SQLite code

Combining the two, the module compiles and is installed, but the apache process dies immediately every time it is loaded. Stripping out all the SQLite code and simply linking against SQLite causes this problem. In other words, with the same code:

apxs -cia -L/usr/local/lib -I/home/devin mod_hello.c 
/* Works Fine, prints "hello world" */

apxs -cia -L/usr/local/lib -I/home/devin -lsqlite3 mod_hello.c 
/* compiles but dies on apache load */

The platform is OpenBSD 4.6 with the platform's version of Apache 1.3 and SQLite 3.6.20 downloaded from the SQLite site and compiled from source

A: 

Normally when this happens, either libsqlite3.so isn't in LD_ LIBRARY_PATH, or libsqlite3.so isn't quite what you want to link to, i.e. there's e.g. libsqlite3.1.so that you want to link to. So my advice is to check the load-time paths, to make sure libsqlite3.so is there, and to check if there's a libsqlite3.x.so somewhere that you may need to link to instead. (-lsqlite3.x instead of -lsqlite3

Thanks for you help!I find the following in /usr/local/lib :libsqlite3.alibsqlite3.lalibsqlite3.so.8.6using -lsqlite3.8.6 fails to compile. Making a symlink from libsqlite3.so.8.6 to libsqlite3.so in that directory causes no change in the original behavior -- the module compiles, but apache core dumps on launch.
Devin Ceartas
+1  A: 

The problem had to do with my downloading SQLite and compiling - when I deleted all those resulting files and installed the OpenBSD package for SQLite, it worked fine. So there must be some platform-specific compile tweaks needed for the SQLite library. Best to use the packages I guess.

-- devin

Devin Ceartas