gh-74573: document that ndbm can silently corrupt databases on macOS (GH-113354)
* gh-74573: document that ndbm can silently corrupt databases on macOS
The system ndbm implementation on macOS has an undocumented limitation
on the size of values and can silently corrupt database files when those
are exceeded.
(cherry picked from commit
593b4d81d276b428f926debfe70d56ba94edf0e1)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
compatibility interface. On Unix, the :program:`configure` script will attempt
to locate the appropriate header file to simplify building this module.
+.. warning::
+
+ The ndbm library shipped as part of macOS has an undocumented limitation on the
+ size of values, which can result in corrupted database files
+ when storing values larger than this limit. Reading such corrupted files can
+ result in a hard crash (segmentation fault).
+
.. exception:: error
Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:`KeyError` is raised
differs across Unix versions and requires knowledge about the database
implementation used.
+* On macOS :mod:`dbm.ndbm` can silently corrupt the database file on updates,
+ which can cause hard crashes when trying to read from the database.
+
.. class:: Shelf(dict, protocol=None, writeback=False, keyencoding='utf-8')
--- /dev/null
+Document that :mod:`dbm.ndbm` can silently corrupt DBM files on updates when
+exceeding undocumented platform limits, and can crash (segmentation fault)
+when reading such a corrupted file. (FB8919203)