See if you can get it to crash inside the gdb, and then run "call gdb_backtraces()" while you still have a process. It will print where it is in your pike program.
You need to compile with --with-valgrind to be able to use valgrind, I've heard. I think it marks the shifts between data and code better then.