[New-bugs-announce] [issue34826] io.BufferedReader crashes in 2.7 on memoryview attribute access

Gregory P. Smith report at bugs.python.org
Thu Sep 27 18:58:54 EDT 2018


New submission from Gregory P. Smith <greg at krypto.org>:

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.

----------
components: IO, Library (Lib)
messages: 326597
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: io.BufferedReader crashes in 2.7 on memoryview attribute access
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34826>
_______________________________________


More information about the New-bugs-announce mailing list