[issue19878] bz2.BZ2File.__init__() cannot be called twice with non-existent file

2013-12-10 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3337298f5c75 by Nadeem Vawda in branch '2.7':
Skip test for #19878 on Windows.
http://hg.python.org/cpython/rev/3337298f5c75

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19878] bz2.BZ2File.__init__() cannot be called twice with non-existent file

2013-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 55a748f6e396 by Nadeem Vawda in branch '2.7':
Closes #19878: Fix segfault in bz2 module.
http://hg.python.org/cpython/rev/55a748f6e396

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19878] bz2.BZ2File.__init__() cannot be called twice

2013-12-03 Thread STINNER Victor

STINNER Victor added the comment:

I can reproduce the issue with Python 2.7. The problem is that 
BZ2File.__init__() doesn't reset the object when __init__() is called twice.

For example, the following script fails with too many open files error, 
before the previous file is not called:
---
import bz2
obj = bz2.BZ2File('bla.bz2')
for loop in range(1024*10):
obj.__init__('bla.bz2')
---

By the way, why do you call __init__() twice? Why not creating a new object?

BZ2File was rewritten in pure Python in Python 3.3. Python 3.3+ is not affected 
by this issue.

--
nosy: +haypo, serhiy.storchaka
resolution: rejected - 
stage: committed/rejected - 
status: closed - open
title: PyFile_DecUseCount() SIGSEGV - bz2.BZ2File.__init__() cannot be called 
twice
versions: +Python 2.7 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19878] bz2.BZ2File.__init__() cannot be called twice

2013-12-03 Thread Matthew Bergin

Matthew Bergin added the comment:

I was fuzzing the interpreter otherwise it would init itself

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19878] bz2.BZ2File.__init__() cannot be called twice

2013-12-03 Thread Nadeem Vawda

Nadeem Vawda added the comment:

It appears that this *does* affect 2.7 (though not 3.2, 3.3 or 3.4, 
fortunately):

~/src/cpython/2.7☿ gdb --ex run --args ./python -c 'import bz2; obj = 
bz2.BZ2File(/dev/null); obj.__init__()'
«... snip banner ...»
Starting program: /home.u/nadeem/src/cpython/2.7/./python -c import\ bz2\;\ 
obj\ =\ bz2.BZ2File\(\/dev/null\\)\;\ obj.__init__\(\\\)
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
Traceback (most recent call last):
  File string, line 1, in module
IOError: [Errno 2] No such file or directory: ''

Program received signal SIGSEGV, Segmentation fault.
0x00431d3e in PyFile_DecUseCount (fobj=0x0) at 
Objects/fileobject.c:89
89  fobj-unlocked_count--;

--
assignee:  - nadeem.vawda
nosy: +nadeem.vawda
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19878] bz2.BZ2File.__init__() cannot be called twice with non-existent file

2013-12-03 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the preliminary patch.

--
keywords: +patch
nosy: +vajrasky
title: bz2.BZ2File.__init__() cannot be called twice - bz2.BZ2File.__init__() 
cannot be called twice with non-existent file
Added file: 
http://bugs.python.org/file32965/fix_segfault_in_bz2_init_non_existent_file.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19878
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com