On Sat, 2006-10-21 at 08:13 -0700, Aaron Stone wrote: > On Fri, 2006-10-13 at 09:02 +0200, Paul J Stevens wrote: > > Steve, > > > > Dbmail doesn't need more segments than processes running. The fact that > > we're sometimes seeing this behaviour indicates a bug in dbmail. > > >From man shmget: > exit() Upon exit() all attached shared memory segments are > detached (not destroyed). > ^^^^^^^^^^^^^ > > Destruction of shared memory segments happens with shmctl(, IPC_RMID, ) > which appears only in scoreboard_delete. > > scoreboard_delete is only called from server.c / StartServer, which is > the "middle-level" process. So my guess, then, is that the middle > process is dying and leaving shared memory segments laying around?
Yes. Whenever something that is FATAL happens to the *middle* process, it does not clean up after itself. Simply registering scoreboard_delete with atexit resolves the issue. I will have a fix in SVN later today. > A quick test by killing the middle process does not confirm this. > Instead, the middle process died, the parent process exited, and a child > process was left all by itself serving connections. > > That ain't good, either! I might try to fix this, but given that it happened because of a kill -9, it's one of those "root gets what root asks for" situations. Aaron
