[New-bugs-announce] [issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file
Robert Xiao
report at bugs.python.org
Fri Apr 3 03:24:44 CEST 2009
New submission from Robert Xiao <nneonneo at gmail.com>:
(tested and verified on Windows and Solaris SPARC)
Running this code in Python 2.4, 2.5 or 2.6 (all minor versions)
produces garbage.
f=open("anyfile","w")
f.write("garbage")
f.readline()
Mac OS X and Linux appear to simply throw an "IOError: [Errno 9] Bad
file descriptor" exception, while using a read method without writing
first produces the same exception on Windows and certain versions under
Solaris.
Under Solaris, it is further possible to segfault the interpreter with
this code:
f=open("anyfile","w")
f.read()
In the former case, it appears as if the data is simply read from the
disk block containing the file. In the latter, I have no clue what is
going on.
In Python 3.0, file objects opened with "w" don't even support any .read
methods, so this does not affect Py3k.
----------
components: Interpreter Core
messages: 85286
nosy: nneonneo
severity: normal
status: open
title: Serious interpreter crash and/or arbitrary memory leak using .read() on writable file
type: crash
versions: Python 2.4, Python 2.5, Python 2.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5677>
_______________________________________
More information about the New-bugs-announce
mailing list