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.

classification
Title: io.BufferedReader crashes in 2.7 on memoryview attribute access
Type: crash Stage: resolved
Components: IO, Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Crash when RawIOBase.write(b) evaluates b.format
View: 27195
Assigned To: Nosy List: ZackerySpytz, gregory.p.smith, xtreak
Priority: normal Keywords:

Created on 2018-09-27 22:58 by gregory.p.smith, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg326597 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-09-27 22:58
The following test code segfaults on Python 2.7:

```python
import io
class X(io.RawIOBase):
  def readable(self):
    return True
  def readinto(self, b):
    if isinstance(b, memoryview):
      print(b.format)  # XXX boom, crashes here.
    return 0

io.BufferedReader(X()).read(8)
```

The crash happens on the b.format attribute access.

This does not happen on 3.6.
msg326598 - (view) Author: Zackery Spytz (ZackerySpytz) * (Python triager) Date: 2018-09-27 23:21
See #27195 and PR 8415.
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 79007
2019-03-28 13:54:44methanesetstatus: open -> closed
superseder: Crash when RawIOBase.write(b) evaluates b.format
resolution: duplicate
stage: needs patch -> resolved
2018-09-28 05:22:33xtreaksetnosy: + xtreak
2018-09-27 23:21:42ZackerySpytzsetnosy: + ZackerySpytz
messages: + msg326598
2018-09-27 22:58:54gregory.p.smithcreate