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 twouters
Recipients gregory.p.smith, twouters
Date 2017-03-29.17:09:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490807349.39.0.701880825332.issue29942@psf.upfronthosting.co.za>
In-reply-to
Content
itertools.chain.from_iterable (somewhat ironically) uses recursion to resolve the next iterator, which means it can run out of the C stack when there's a long run of empty iterables. This is most obvious when building with low optimisation modes, or with Py_DEBUG enabled:

Python 3.7.0a0 (heads/master:c431854a09, Mar 29 2017, 10:03:50) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import itertools
>>> next(itertools.chain.from_iterable(() for unused in range(10000000)))
Segmentation fault (core dumped)
History
Date User Action Args
2017-03-29 17:09:09twouterssetrecipients: + twouters, gregory.p.smith
2017-03-29 17:09:09twouterssetmessageid: <1490807349.39.0.701880825332.issue29942@psf.upfronthosting.co.za>
2017-03-29 17:09:09twouterslinkissue29942 messages
2017-03-29 17:09:09twouterscreate