[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 89b9e4bf6f1f by Charles-François Natali in branch '2.7': Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle http://hg.python.org/cpython/rev/89b9e4bf6f1f -- ___ Python tracker

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Your application does not segfault with 2.7 because buffered files and sockets use a very different implementation. The io module is present in all versions, but only Python3 uses it for all file-like objects. If the unit test (test_rwpair_cleared_before

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-06 Thread Victor Semionov
Victor Semionov added the comment: I did not see any segfaults when I ran my app on 2.7. Please verify that 2.7 is really affected before making changes. -- ___ Python tracker

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Charles-François Natali
Charles-François Natali added the comment: > The issue doesn't affect Python 2.7? > Duh! I was sure the _io module had been introduced in Python 3 (I/O layer rewrite, etc). Yes, it does apply to 2.7. I'll commit the patch later today. -- ___ Python

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread STINNER Victor
STINNER Victor added the comment: The issue doesn't affect Python 2.7? -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list ma

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Victor Semionov
Victor Semionov added the comment: Great, thanks to you too, for fixing it! -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Charles-François Natali
Charles-François Natali added the comment: Committed to 3.2 and default. Victor, thanks for the report! -- resolution: -> fixed stage: -> committed/rejected status: open -> closed ___ Python tracker ___

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset d60c00015f01 by Charles-François Natali in branch '3.2': Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle http://hg.python.org/cpython/rev/d60c00015f01 New changeset 7defc1e5d13a by Charles-François Natali in branch 'defau

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Antoine Pitrou
Antoine Pitrou added the comment: The latest patch looks good to me. As for the error message, how about "the BufferedRWPair object is being garbage-collected". -- ___ Python tracker _

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-05 Thread Charles-François Natali
Charles-François Natali added the comment: Sorry, forgot about this issue... Updated patch (I'm not really satisfied with the error message, don't hesitate if you can think of a better wording). -- Added file: http://bugs.python.org/file23319/buffered_closed_gc-3.diff _

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-04 Thread Charles-François Natali
Charles-François Natali added the comment: > Probably. OTOH, not setting the error state when returning NULL is > usually an error (and can result in difficult-to-debug problems), so > let's stay on the safe side. > RuntimeError perhaps. OK, I'll update the patch accordingly. > Does that mean

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-04 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: An "unraisable exception" warning will be displayed. -- ___ Python tracker ___ ___ Python-bug

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-04 Thread Victor Semionov
Victor Semionov added the comment: > Probably. OTOH, not setting the error state when returning NULL is > usually an error (and can result in difficult-to-debug problems), so > let's stay on the safe side. > > > Furthermore, I'm not sure about what kind of error would make sense here. > > Runt

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > > Also, is it ok to just return NULL or should the error state also be > > set? > > Well, I'm not sure, that why I made you and Amaury noisy :-) > AFAICT, this is the only case where _check_closed can encounter a NULL > self->writer. Probably. OTOH, not sett

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-03 Thread Victor Semionov
Victor Semionov added the comment: Any plans to fix this in the next release? -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-01 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file23279/buffered_closed_gc-1.diff ___ Python tracker ___ ___ Pytho

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-01 Thread Charles-François Natali
Charles-François Natali added the comment: > Shouldn't the test use "self.BufferedRWPair" instead of > "io.BufferedRWPair"? Yes. > Also, is it ok to just return NULL or should the error state also be > set? Well, I'm not sure, that why I made you and Amaury noisy :-) AFAICT, this is the only

[issue13070] segmentation fault in pure-python multi-threaded server

2011-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Shouldn't the test use "self.BufferedRWPair" instead of "io.BufferedRWPair"? Also, is it ok to just return NULL or should the error state also be set? -- ___ Python tracker __

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Victor Semionov
Victor Semionov added the comment: Thanks Charles-François, I tested your patch with "make test" and with my program. Both work fine. -- ___ Python tracker ___

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Charles-François Natali
Changes by Charles-François Natali : Added file: http://bugs.python.org/file23279/buffered_closed_gc-1.diff ___ Python tracker ___ ___ Python-

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file23278/buffered_closed_gc-1.diff ___ Python tracker ___ ___ Pytho

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Charles-François Natali
Changes by Charles-François Natali : Removed file: http://bugs.python.org/file23277/buffered_closed_gc.diff ___ Python tracker ___ ___ Python-

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Charles-François Natali
Charles-François Natali added the comment: With test. -- Added file: http://bugs.python.org/file23278/buffered_closed_gc-1.diff ___ Python tracker ___ __

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-30 Thread Charles-François Natali
Charles-François Natali added the comment: Confirmed with default. The problem is that the TextIOWrapper gets collected after the underlying BufferedRWPair has been cleared (tp_clear) by the garbage collector: when _PyIOBase_finalize() is called for the TextIOWrapper, it checks if the textio

[issue13070] segmentation fault in pure-python multi-threaded server

2011-09-29 Thread Victor Semionov
New submission from Victor Semionov : Hello, I'm developing a multi-threaded TCP server and have been seeing segmentation faults on 3.2 on Linux and 3.2.2 on Windows. This happens when using only pure-Python libraries, so I believe the problem is in the interpreter. The issue is very easy to