[issue8865] select.poll is not thread safe

2012-12-04 Thread Christian Schubert
Christian Schubert added the comment: What's a proper test for this? Testing, that the (now expected) exception occurs when invoking poll concurrently? Or rather, that the race condition does not occur? Last time I checked, pypy handled the concurrent poll invocation well, so it would

[issue8865] select.poll is not thread safe

2012-11-13 Thread Christian Schubert
Christian Schubert added the comment: > Would you please submit a PSF contributor agreement form? FYI: did that yesterday 9:43 UTC, no reaction (yet) -- ___ Python tracker <http://bugs.python.org/iss

[issue8865] select.poll is not thread safe

2012-11-12 Thread Christian Schubert
Christian Schubert added the comment: > I doubt about the exception type. May be RuntimeError is more appropriate? mea culpa, just copy&pasted without actually looking; fixed in v3 -- Added file: http://bugs.python.org/file27968/issue8865_

[issue8865] select.poll is not thread safe

2012-11-12 Thread Christian Schubert
Christian Schubert added the comment: new proposed fix: forbid concurrent poll() invocation -- Added file: http://bugs.python.org/file27967/issue8865_v2.diff ___ Python tracker <http://bugs.python.org/issue8

[issue8865] select.poll is not thread safe

2012-11-11 Thread Christian Schubert
Christian Schubert added the comment: > How about raising an error on concurrent modification, instead of trying to > make it thread-safe? That's totally fine with me. -- ___ Python tracker <http://bugs.python

[issue8865] select.poll is not thread safe

2010-06-15 Thread Christian Schubert
Christian Schubert added the comment: added a patch which fixes both issues before releasing the GIL we take a copy of the ufds pointer and its len, erasing the ufds pointer in the poll object (to make sure nobody else fiddles with it); when we're done we either but it back into the o

[issue8865] select.poll is not thread safe

2010-06-01 Thread Christian Schubert
Christian Schubert added the comment: the other issue (poll_register freeing data structures that poll_poll currently uses) can be reproduced by the attached script (at least I can) depending on the parameters/circumstances it either segfaults or prints garbage results from poll, e.g

[issue8865] select.poll is not thread safe

2010-05-31 Thread Christian Schubert
Christian Schubert added the comment: okay, I've managed to put together a script that fairly consistently reproduces the problem on my (core2 duo 2,something GHz) machine some parameters (sleep times) are randomized in each iteration, the script runs for 30 iterations, each for 1 s

[issue8865] select.poll is not thread safe

2010-05-31 Thread Christian Schubert
New submission from Christian Schubert : invoking select.poll.poll() concurrently from multiple threads frequently yields garbage in one thread: while poll_poll in thread 1 is parsing its result, another thread 2 calling poll may overwrite revents; assuming poll_result was 1 in thread 1 and