
using GCC 3.2). However, I'm extremely frustrated to find that I have a major problem with the software under HP-UX: it seems to CORE dump after running for "some time" (typically 2 - 3hrs).
I see you are using gcc and gdb. You can run the program under gdb to see what it does. I see you are using multithreading: that makes tracking it with gdb more complicated. I have found with processes that are forked that gdb gets associated with the parent process and if the bug is in the child process it is hard to track. I haven't gone deeply enough into it to find out if there is a way of associating gdb with the correct process. Alternatively, since the daemon core dumps, you can run it as normal until it crashes and then use gdb to load the core dump and report the state of the process at the time of dumping. You compile the program with the -g option (for debugging info) and run it. When it has faulted and core dumped (make sure you allow it to write a full core dump file) you then run gdb as: gdb <executable> <coredumpfile> and you can use the 'bt' command (for backtrace, I think) to get a report on the stack and which routines called which one, and at exactly what point the program faulted. You can use the 'print' command to check local variables (of the current frame) and global variables as they were at the time of the program core dumping. That might reveal what happened. This can all be run with a text terminal only thus solving your problem with a slow X Window connection. I personally have no experience with HP-UX so can't help with any issues specific to HP-UX, but have used gcc and gdb under three different flavours of Unix (four if you count Mac OS X). 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. Michael.