petela(at)gocougs(dot)wsu(dot)edu writes:
> We are upgrading from Postgresql 8.3.7 to 9.3.3, and we are getting a
> database crash due to a failure in a C extension. In this extension we are
> trying to spawn an external program to run in the background. We do this
> with double fork(), with the first child exiting cleanly, and the second
> child execing the program.
on_exit_reset() in the first-level child would likely be a good idea.
See atexit_callback in src/backend/storage/ipc/ipc.c: your first-level
child is killing all the parent backend's shared-memory state when it
does exit(). This is a safety feature we added at some point in the
past few years, but in your usage I guess its an anti-safety feature...
regards, tom lane