
Thank you both Oliver and Michael for your replies. I'm not convinced that the problem is memory related. I can guarantee that I have no leaks under Windows and based on the facts that I did not notice any unusual growth in memory usage under the code difference between the windows service and the Unix daemon are trivial I'm unconvinced that it is the application that leaks. Personally I fear that it has something to do with kernel parameter settings (I'm suspicious of maxdsiz and maxssiz) under HP-UX, but I'm really not qualified enough to make such a claim. A fact is that the application is naturally memory hungry (I have seen it peak at over 100MB under heavy load) and it may well be that under HP-UX it cores when it hits an OS imposed wall. I have analysed the core dump files many times using gdb but the failure occures at random places and I found nothing obvious. The only strange thing is that it appears that the application bombs once it ties to allocate morte than 8MB of RAM from the heap. There is one more major difference between the HP-UX and the other environments: the HP9000 is a multi CPU machine, while both my Linux and WinXP Pro boxes a are single CPU machines. For this reason, concurrency issues (thread synchronisation) is another area I'd like to focus on when chasing this bug. Anyway, I'm at my wits end and need help from someone smarter.
Indeed. His problems sound memory related. A double free, leak or a dereference of an invalid pointer. Tools like ValGrind, dmalloc, ElectricFence and the like will probably help.
If the problem is memory leaks and the like you could link the daemon with a specialised memory management library that mungs memory that is allocated (i.e. puts in pointer values outside the current process memory location so that if they are dereferenced they will cause a segmentation violation) and puts walls around memory allocations so that if you overwrite a memory allocation it is detected when you free the memory. I have found such tools very useful for tracking memory overwrite problems.