Assertion `t_size >= b_size’ failed

Recently, when migrating a Plone 4 site from one VPS server instance to another, we had the following problem:

We were not able to start Zope with Supervisord because it crashed every time we tried to start it. Running Zope in foreground (bin/instance fg) produced the following error:

Python: Objects/typeobject.c:1736: extra_ivars: Assertion `t_size >= b_size' failed.
Aborted

Luckily, after some Googling around I discovered that Hanno had already commited a patch to fix this. Pinning eggs to patched versions by adding the lines below to versions.cfg fixed the problem entirely.

# Handle tp_basicsize correctly
ExtensionClass = 2.13.2
Persistence = 2.13.2