This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author evan.jones@bluecore.com
Recipients evan.jones@bluecore.com, ned.deily, ronaldoussoren
Date 2016-05-26.14:27:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464272878.96.0.814422528364.issue27126@psf.upfronthosting.co.za>
In-reply-to
Content
To be clear: My reproduction scripts crash both Python 2.7.10 and Python 3.5.1 when you:

1. Download the source bundle from python.org.
2. Run ./configure; make
3. Use the built binary (because ./configure picks up the system version of libsqlite.dylib)

I did some more digging: The underlying root cause is Mac OS X's libdispatch.dylib. A ton of system APIs (like this proxy one, or GUI libraries, etc), use it. It seems the proxy settings API use it to manage inter-process communication. libdispatch has code that explicitly "poisons" the process if it forks. I think this is because it internally spawns threads, so the forked child state is unreliable, and they figure it is better for it to crash than to fail randomly. This is the classic "don't mix threads and fork" issue, its just that the threads are hidden inside a bunch of system APIs.

One fix for this particular bug would be for _scproxy to fork and use IPC to read the settings, which I think was mentioned in Issue13829. I think it would not also be crazy to ship the amalgamated sqlite3 with Python, to avoid an accidental dependency on sqlite3.

Finally: it might make sense to have 'forkserver' be the default mode for multiprocessing on Mac OS X, since there are other things that cause this same problem (Tkinter is reported on the internet).
History
Date User Action Args
2016-05-26 14:27:59evan.jones@bluecore.comsetrecipients: + evan.jones@bluecore.com, ronaldoussoren, ned.deily
2016-05-26 14:27:58evan.jones@bluecore.comsetmessageid: <1464272878.96.0.814422528364.issue27126@psf.upfronthosting.co.za>
2016-05-26 14:27:58evan.jones@bluecore.comlinkissue27126 messages
2016-05-26 14:27:58evan.jones@bluecore.comcreate