There is probably something extra (or missing) in the environment when being called from aolserver. See if your program is dropping a core file. If so, you can use a debugger (gdb works) and see where it segfaulted. If not, you may need to use coreadm to enable core files.