Hi Kaushal,

Stuff like this is probably better discussed on the apache-modules list. You can subscribe to that at:

http://modules.apache.org/subscribe

On Jan 19, 2006, at 9:08 AM, Kaushal Jha wrote:

how should I approach cleaning up this code (which spans multiple files) of all the null pointer issues. is there some tool that could show me where the
problem  is at ?

The best tool to use is probably gdb in combination with core dumps.

How to make Apache dump core on segmentation faults is different for every opereating system. It looks like the information on http:// httpd.apache.org/dev/debugging.html is somewhat specific to Solaris, we should probably include some tips about Linux and other operating systems as well.

On Linux:

1) Make sure to run ulimit -c unlimited from the shell that
   is going to start Apache. You can hack this into the
   apachectl script or the rc?.d startup script for your
   server.
2) Add the directive:

   CoredumpDirectory /somewhere

   to your httpd.conf. The location (/somewhere) needs
   to be a directory that the httpd child processes
   can write to, so it must be writable by the user
   name specified in the User directive (or by everyone,
   but that's up to you). The disk partition that holds
   this directory must also have enough space to store
   all the core images you expect to receive.

You can analyze the core images by running

$ gdb /path/to/httpd -core /somewhere/yourcore

I can't go into details on how to use gdb (the bt command should cover most of your needs), but there is ample literature about that.

To use gdb, it's probably a good idea to compile Apache with debugging symbols. You can do this by specifying

$ CFLAGS="-DDEBUG -g -O0" ./configure ...

when you start the build process.

Good luck!

S.

--
[EMAIL PROTECTED]              http://www.temme.net/sander/
PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to