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
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
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_
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
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
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
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
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
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