Skip to content

Add workaround for bpo-36880 crash to ctypes_patch#136

Merged
freakboy3742 merged 4 commits intobeeware:masterfrom
dgelessus:ctypes_patch_none_refcount_workaround
May 25, 2019
Merged

Add workaround for bpo-36880 crash to ctypes_patch#136
freakboy3742 merged 4 commits intobeeware:masterfrom
dgelessus:ctypes_patch_none_refcount_workaround

Conversation

@dgelessus
Copy link
Copy Markdown
Contributor

This fixes the crash reported in beeware/toga#549 by adding a workaround for CPython/ctypes bug bpo-36880.

I've also made a PR to CPython with a fix for the bug itself (python/cpython#13364). This workaround is still important though, as it prevents the crash on Python versions that don't have the proper fix (which is currently all of them, and even once the patch gets merged it will only be included with Python 3.8 and newer, and maybe in a future Python 3.7 update).

dgelessus added 4 commits May 25, 2019 01:17
Previously, our ctypes_patch would trigger a bug in ctypes
(see https://bugs.python.org/issue36880 and python/cpython#13364),
which would eventually crash Python if done too often. This workaround
changes our ctypes_patch implementation so that it no longer triggers
the ctypes bug.

This fixes the crash reported in beeware/toga#549.
Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliciously ugly... Nicely done :-)

@freakboy3742 freakboy3742 merged commit 00f77ec into beeware:master May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants