APR's shared memory implementation isn't suitable for writing Subversion's
synchronisation code for the revprop cache. The problem is that when creating
named shared memory using apr_shm_create APR installs a pool cleanup handler
that removes the file.
Without a long-lived parent process the failure mode is
- process 1 starts and creates a shared memory segment
- process 2 starts and attaches to the same segment
- process 1 exits and cleans up, process 2 still using the segment
- process 3 starts and creates a new shared memory segment
At this point processes 2 and 3 are using different shared memory segments.
There is another smaller issue: the creation of the segment is protected by lock
that excludes other processes but the cleanup is not protected. There is a
window during cleanup when the shared memory has been deleted but the file still
exists. At this point another process will not be able to create a new shared
memory segment or attach to an existing segment.
http://mail-archives.apache.org/mod_mbox/subversion-dev/201210.mbox/%3C87lieoxey9.fsf@stat.home.lan%3E
http://svn.haxx.se/dev/archive-2012-10/0448.shtml