[Rpm-maint] [rpm-software-management/rpm] Rpm query causes corruption in the file-backed mmaped bdb regions (#232)
Jeff Johnson
notifications at github.com
Mon Jun 12 10:58:35 UTC 2017
Once a dbenv is damaged for whatever reason (including reboots, segfaults, bugs, whatever), all future accesses are going to report DB_RUNRECOVERY.
(aside)
The right fix when DB_RUNRECOVERY is returned: (drum roll please) to run a recovery and repeat the open once.
RPM hysterically (I don't known the current rpm.org implementation, but am about to look) also reopens an rpmdb/dbenv to achieve RDONLY -> RDWR, and unlinks dbenv files (trusting that the .dbenv lock is sufficient protection.
Both the reopen/removal open race windows, where there are no locks held (except .dbenv.lock) because the dbenv is closed, or because the dbenv cannot be shared.
The approaches using DB_PRIVATE, or not using a dbenv as non-root, are all equivalent to not locking.
Off to look at sources and view "endless row of bugs" with BDB ...
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/232#issuecomment-307757520
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170612/85ccd531/attachment.html>
More information about the Rpm-maint
mailing list