Hi,

The development of asyncio and trollius helped to identify and fix
different bugs in CPython. You may be interested to know them to maybe
workaround them if needed. I worked around the gen.send & sys.exc_info
issues in asynco and trollius.

The most recent issue is the sys.exc_info() issue when
yield/yield-from is used in an except block of a generator.


* 3.3.0 <= python <= 3.4.0: `gen.send(tuple) unpacks the tuple instead of
  passing 1 argument (the tuple) when gen is an object with a send() method,
  not a classic generator (#21209) <http://bugs.python.org/21209>`_.
  Regression introduced in Python 3.4.0, fixed in Python 3.4.1.
  trollius.CoroWrapper.send() works around the issue, the bug is checked at
  runtime once, when the module is imported.

In asyncio, the bug only impacts asyncio in debug mode, since
CoroWrapper is only used in debug mode.


* 2.5.0 <= python <= 3.4.2: `sys.exc_info() bug when yield/yield-from is used
  in an except block in a generator (#23353>)
  <http://bugs.python.org/issue23353>`_.  The fix will be part of Python 3.4.3.
  _UnixSelectorEventLoop._make_subprocess_transport() and
  ProactorEventLoop._make_subprocess_transport() work around the bug.

On Python 3, this issue creates surprising memory leak since the last
exception may be kept too long, while an exception has a reference to
a traceback object which indirectly has references to many local
variables.

I recompiled Python 2.2, 2.3, 2.4 and 2.5 to check when the bug was
introduced. yield was introduced in Python 2.2 (it required "from
__future__ import generators"), but the generator type was only
introduced in Python 2.5 (gen.send, gen.throw).


* python == 3.4.0: `Segfault in gc with cyclic trash (#21435)
  <http://bugs.python.org/issue21435>`_.
  Regression introduced in Python 3.4.0, fixed in Python 3.4.1.
  Status in Ubuntu the February, 3th 2015: only Ubuntu Trusty (14.04 LTS) is
  impacted (`bug #1367907:  Segfault in gc with cyclic trash
  <https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1367907>`_, see
  also `update Python3 for trusty #1348954
  <https://bugs.launchpad.net/ubuntu/+source/python3.4/+bug/1348954>`_)

This bug is annoying on Ubuntu Trusty. It will be fixed directly in
Ubuntu, probably with an upgrade of the python3.4 package to 3.4.3. I
didn't understand if they plan to release before a new 3.4.0 package
with the patch.

There is no known workaround.

Victor

Reply via email to