Running this program. ``` python from offset import maintask, run, go, makechan def gopher(left, right): value = right.recv() left.send(value + 1) def starter(chan): chan.send(1) @maintask def main(): leftmost = makechan() right = leftmost left = leftmost for _ in range(10000): right = makechan() go(gopher, left, right) left = right go(starter, right) print(leftmost.recv()) if __name__ == "__main__": run() ``` I get: ``` $ python gophers.offset.py zsh: segmentation fault python gophers.offset.py ``` The output I expected was `10001`. Tested with - Interpreters - `Python 2.7.3 (87aa9de10f9ca71da9ab4a3d53e0ba176b67d086, Feb 03 2014, 13:03:18)[PyPy 2.2.1]` - `Python 3.3.3 (default, Dec 22 2013, 19:33:55)` - offset library from github - fibers 0.3.0 I don't know if this is caused by the offset library, fibers library or any other combination so I decided to start from here. :)
Activity
benoitc commentedon Feb 9, 2014
I reproduced it with python 3.4 as well. Reducing the number in the range make the problem disappear so I suspect a race condition.
I am about to replace the channels with an improved version, i will have a a look on that at the same time. Thanks for the test!
benoitc commentedon May 17, 2014
it will be fixed with the new scheduler.