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 gregory.p.smith
Recipients gregory.p.smith
Date 2017-03-02.19:48:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488484095.89.0.988668664064.issue29700@psf.upfronthosting.co.za>
In-reply-to
Content
The readline module causes memory corruption (sometimes a crash) when the sys.stdin file descriptor is out of bounds for its FD_SET() call within readline.c's readline_until_enter_or_signal() function.

https://github.com/python/cpython/blob/master/Modules/readline.c#L1228

A tiny program reproducing this problem is attached.

FD_SET should not be used if the file descriptor is too large for use in select() (ie: >= FD_SETSIZE).  OTOH, we should probably just ditch select() entirely and use poll() here so that this issue does not exist.

On Python 2.7-3.6 we probably need to preserve both select and poll options for platform compatibility reasons since those shipped that way.

For Python 3.7 I suggest we stop supporting platforms that do not have poll() unless anyone knows of any that actually exist.
History
Date User Action Args
2017-03-02 19:48:15gregory.p.smithsetrecipients: + gregory.p.smith
2017-03-02 19:48:15gregory.p.smithsetmessageid: <1488484095.89.0.988668664064.issue29700@psf.upfronthosting.co.za>
2017-03-02 19:48:15gregory.p.smithlinkissue29700 messages
2017-03-02 19:48:15gregory.p.smithcreate