I am sorry to intrude in this thread. But I think there is a vulnerability in macos caused by ftruncate. For instance running the following code abruptly crashed macos (mojave and catalina).

from multiprocessing.shared_memory import SharedMemory
shm = SharedMemory(name='test-crash', create=True, size=1000000000000000000)
This is being tracked at https://bugs.python.org/issue39584.
Could please comment whether this should be fixed by python, or we should wait for a macos fix.

On 12-Aug-2020, at 4:38 PM, Victor Stinner <vstinner@python.org> wrote: