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 navytux
Recipients arigo, beazley, benjamin.peterson, brian.curtin, dabeaz, flox, jyasskin, kristjan.jonsson, loewis, mariosoft, navytux, ned.deily, paul.moore, pitrou, python-dev, r.david.murray, rhettinger, ronaldoussoren, sbt, scoder, shihao, techtonik, tim.golden, tim.peters, torsten, vstinner, ysj.ray
Date 2019-10-03.07:56:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570089371.99.0.107614941299.issue38106@roundup.psfhosted.org>
In-reply-to
Content
Victor, thanks for merging.

> I'm surprised that we still find new bugs in this code which is supposed to
> be battle tested! Maybe recent Darwin changed made the bug more likely.

As discussed above (https://bugs.python.org/issue38106#msg351917,
https://bugs.python.org/issue38106#msg351970), due to the GIL, the bug is not
possible to trigger from pure-python code, and it can be hit only via using CAPI
directly. I indeed started to observe the problem after moving locks and
other code that implement channels in Pygolang from Python to C level (see
"0.0.3" in https://pypi.org/project/pygolang/#pygolang-change-history)

The bug was there since 1994 and, from my point of view, it was not discovered
because locking functionality was not enough hammer-tested. The bug was also
not possible to explain without taking lock lifetime into account, as, without
create/destroy, just lock/unlock sequence was race free. 
https://bugs.python.org/issue433625 confirms that.

I cannot say about whether recent macOS changes are relevant. My primary
platform is Linux and I only recently started to use macOS under QEMU for
testing. However from my brief study of https://github.com/apple/darwin-libpthread
I believe the difference in scheduling related to pthread condition variable
signalling under macOS and Linux is there already for a long time.

> PyPy: it's now your turn to fix it ;-)

PyPy people fixed the bug the same day it was reported:

https://bitbucket.org/pypy/pypy/issues/3072

:)

Kirill

P.S. Mariusz, thanks also for your feedback.
History
Date User Action Args
2019-10-03 07:56:12navytuxsetrecipients: + navytux, tim.peters, loewis, arigo, rhettinger, beazley, paul.moore, shihao, ronaldoussoren, pitrou, scoder, kristjan.jonsson, vstinner, techtonik, jyasskin, tim.golden, benjamin.peterson, ned.deily, r.david.murray, brian.curtin, flox, dabeaz, torsten, ysj.ray, python-dev, sbt, mariosoft
2019-10-03 07:56:11navytuxsetmessageid: <1570089371.99.0.107614941299.issue38106@roundup.psfhosted.org>
2019-10-03 07:56:11navytuxlinkissue38106 messages
2019-10-03 07:56:11navytuxcreate