Title: io.BufferedReader crashes in 2.7 on memoryview attribute access
Type: crash Stage: resolved
Components: IO, Library (Lib) Versions: Python 2.7
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 2019-03-28 13:54 by methane. 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:

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


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.
Date User Action Args
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