[New-bugs-announce] [issue17105] Python 3.2 segfault
report at bugs.python.org
Sat Feb 2 19:03:34 CET 2013
New submission from Damian:
Hi. While porting a library of mine (https://stem.torproject.org/) to python 3 I've been reliably encountering a python segmentation fault while running its integration tests. After many hours of head scratching I've narrowed the repro to the following script...
def __init__(self, control_socket_file):
demo_queue = queue.Queue()
except ValueError as exc:
for i in range(20):
control_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
control_socket_file = control_socket.makefile(mode = "rw", newline = "")
atagar at morrigan:~$ python3 --version
atagar at morrigan:~$ python3 demo.py
Yes, I realise that the script is stupidly convoluted but it was the minimal amount of code I could get to in order to reproduce the problem. Some things to note...
* You must have an object that gets a reference to an open socket based file.
* You need to have a try/catch block and enqueue that exception. If you get rid of the try/catch or enqueue something else then no segfault for you.
* The segfault isn't entirely reliable (seems so happen half the time or so), hence the loop.
While this repro script is pointless, it's the last issue preventing me from moving to python 3. At this point I'm out of idea so help would be greatly appreciated.
Python: Python 3.2 (r32:88445, Oct 20 2012, 14:09:50)
Platform: Ubuntu 11.04
PS. If the advice is 'upgrade python, 3.2 had some segfault bugs' then a pointer to those bugs would be appreciated. I've sunk quite a few hours into this issue so it would be nice to finally figure out what's up.
title: Python 3.2 segfault
versions: Python 3.2
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce