Author Maxime Belanger
Recipients Maxime Belanger, ned.deily, ronaldoussoren
Date 2017-10-30.19:38:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509392333.58.0.213398074469.issue31903@psf.upfronthosting.co.za>
In-reply-to
Content
Through the use of various Python packages (such as `pyobjc`), it is possible for a deadlock to occur due to how `_scproxy.c` calls `SCDynamicStoreCopyProxies`.

In more recent versions of macOS (10.7+), this function can block on acquiring a lock deep inside `NSUserPreferences`. As `pyobjc` allows Python-wrapped `NSString`s to be stored in `CFPreferences`, it is thus possible for one thread to hold the `CFPreferences` lock and block on the GIL while another thread holds the GIL and blocks on the `CFPreferences` lock.

We've observed this on a significant number of macOS devices before fixing ourselves by wrapping the calls to `SCDynamicStoreCopyProxies` with `Py_BEGIN/END_ALLOW_THREADS`.
History
Date User Action Args
2017-10-30 19:38:53Maxime Belangersetrecipients: + Maxime Belanger, ronaldoussoren, ned.deily
2017-10-30 19:38:53Maxime Belangersetmessageid: <1509392333.58.0.213398074469.issue31903@psf.upfronthosting.co.za>
2017-10-30 19:38:53Maxime Belangerlinkissue31903 messages
2017-10-30 19:38:53Maxime Belangercreate