Personal patches
074f0333fe
databases/lmdb: in db_env_close0(), destroy robust mutexes if we are the only remaining user. When closing an lmdb database, all memory and file descriptor resources are released, including the shared memory pages that contained the robust mutex. However, before this commit, prior to unmapping the pages that contained the robust mutexex, lmdb did not destroy the mutexes first. This would create a problem when an application opens and closes a database, then open it again. According to libthr(3), by default, a shared lock backed by a mapped file in memory is automatically destroyed on the last unmap of the corresponding file' page, which is allowed by POSIX. After unmapping the shared pages, the kernel writes off all active robust mutexes associated with these pages. However, the userland threading library still keeps the record (pshared_lookup in thr_pshared.c of libthr) for these objects as they are not really destroyed before, so that it don't have to ask the kernel every time when looking them up. Now, a later re-open of the database might have mapped the lock file to the same memory location. Because the threading library have remembered the robust mutex object, it would just reuse it even though it was already invalid from kernel's point of view. Unfortunately, regular lock operations would still work for this process. Should another lmdb process opens the same database, it would attempt to obtain the robust mutex (no longer recognized by kernel) because it would see another process holding a file lock, but that would fail because the robust mutex is invalid for the kernel. Explicitly destroy the mutex if we are the last remaining user to ensure the mutex is always in a known defined state. OpenLDAP ITS #9278 With debugging help from: kib PR: 244493 Approved by: ports-secteam |
||
---|---|---|
accessibility | ||
arabic | ||
archivers | ||
astro | ||
audio | ||
base | ||
benchmarks | ||
biology | ||
cad | ||
chinese | ||
comms | ||
converters | ||
databases | ||
deskutils | ||
devel | ||
dns | ||
editors | ||
emulators | ||
finance | ||
french | ||
ftp | ||
games | ||
german | ||
graphics | ||
hebrew | ||
hungarian | ||
irc | ||
japanese | ||
java | ||
Keywords | ||
korean | ||
lang | ||
math | ||
misc | ||
Mk | ||
multimedia | ||
net | ||
net-im | ||
net-mgmt | ||
net-p2p | ||
news | ||
polish | ||
ports-mgmt | ||
portuguese | ||
russian | ||
science | ||
security | ||
shells | ||
sysutils | ||
Templates | ||
textproc | ||
Tools | ||
ukrainian | ||
vietnamese | ||
www | ||
x11 | ||
x11-clocks | ||
x11-drivers | ||
x11-fm | ||
x11-fonts | ||
x11-servers | ||
x11-themes | ||
x11-toolkits | ||
x11-wm | ||
.arcconfig | ||
.gitattributes | ||
.gitauthors | ||
.gitignore | ||
.gitmessage | ||
CHANGES | ||
CONTRIBUTING.md | ||
COPYRIGHT | ||
GIDs | ||
LEGAL | ||
Makefile | ||
MOVED | ||
README | ||
UIDs | ||
UPDATING |
This is the FreeBSD Ports Collection. For an easy to use WEB-based interface to it, please see: https://www.FreeBSD.org/ports For general information on the Ports Collection, please see the FreeBSD Handbook ports section which is available from: https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/ports.html for the latest official version or: The ports(7) manual page (man ports). These will explain how to use ports and packages. If you would like to search for a port, you can do so easily by saying (in /usr/ports): make search name="<name>" or: make search key="<keyword>" which will generate a list of all ports matching <name> or <keyword>. make search also supports wildcards, such as: make search name="gtk*" For information about contributing to FreeBSD ports, please see the Porter's Handbook, available at: https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/porters-handbook/ NOTE: This tree will GROW significantly in size during normal usage! The distribution tar files can and do accumulate in /usr/ports/distfiles, and the individual ports will also use up lots of space in their work subdirectories unless you remember to "make clean" after you're done building a given port. /usr/ports/distfiles can also be periodically cleaned without ill-effect.