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 martin.panter
Recipients JohnLeitch, brycedarling, martin.panter, serhiy.storchaka, vstinner
Date 2015-09-03.03:58:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441252714.16.0.12124601453.issue24989@psf.upfronthosting.co.za>
In-reply-to
Content
Simpler test case, which might find a place somewhere like /Lib/test/test_memoryio.py:

>>> from io import BytesIO
>>> b = BytesIO()
>>> b.seek(1)
1
>>> b.readlines()  # Should return an empty list
Segmentation fault (core dumped)
[Exit 139]

The patch looks like the right approach. Just watch out for the indentation (tabs vs spaces).

However I don’t see why we need the GET_BYTES_SIZE() macro or the (size_t) casting. Would it be okay comparing PyBytes_GET_SIZE() directly to self->pos? They are both meant to be Py_ssize_t.

The bug looks like it was introduced by Serhiy’s changes in Issue 15381.
History
Date User Action Args
2015-09-03 03:58:34martin.pantersetrecipients: + martin.panter, vstinner, serhiy.storchaka, JohnLeitch, brycedarling
2015-09-03 03:58:34martin.pantersetmessageid: <1441252714.16.0.12124601453.issue24989@psf.upfronthosting.co.za>
2015-09-03 03:58:34martin.panterlinkissue24989 messages
2015-09-03 03:58:33martin.pantercreate