Another thing worth mentioning regarding coredumps: If you are running multithreaded in Linux, it will only dump one of the threads. That will make the coredump useless in most cases. To fix it you have to patch the kernel.
Search the kernel archives for "tcore kernel patch" and you should find it. If not, I have one for 2.4.20 that I can make available for you.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-12 01:14: Subject: Catching segfault
Can't you get a coredump? It's usually just as helpful.
Another thing you perhaps can try is to compile Pike with --with-rtldebug. It'll run slower but not unbearably so, and there's a fair chance the extra internal checks will give you a better error to report. (The next step is to add -d but that will probably make it too slow for heavy production use.)
As for catching SIGSEGV in pike, it's possible strictly speaking (just use the normal signal() function), but I suspect it won't work well to try to run any pike code after it has happened. And besides, it's the C-level state that usually is interesting for such errors, and you can't get to that from inside pike. So running gdb on a coredump is much better.
/ Martin Stjernholm, Roxen IS