parallelpython 1.5.7 crash

zeph zephjc at gmail.com
Sat Dec 12 20:13:21 EST 2009


I looked in the browsable svn repo for parallel python at
http://parallelpython.googlecode.com/svn/trunk/

1) OverflowError: long int too large to convert to int

This is a bug in their code (comments are mine) in pytransport.py:

size_packed = self.r.read(struct.calcsize("!Q"))  # reads in 8-
character string
msg_len = struct.unpack("!Q", size_packed)[0]     # unpacks to a long
value, e.g. "12345678" -> 3544952156018063160L
msg = self.r.read(msg_len)                        #
3544952156018063160L is too long for file.read, which I presume must
be able to cast as an int

As an example:
>>> sys.stdin.read(3544952156018063160L)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to int



2) UnboundLocalError: local variable 'sresult' referenced before
assignment

This is another bug in their code. This is an error in pp.py (again,
comments are mine, some code omitted for brevity):

try:
  # ...snip...
  sresult = worker.t.receive()   # sets sresult
except:
  if self.__exiting:
    return
  else:
    # at this point, __run doesn't return, but sresult was not defined
since the
    # execution was unwound because, presumable, the first fatal you
got, the OverflowError
    sys.excepthook(*sys.exc_info())
# ...snip...
job.finalize(sresult)  # UnboundLocalError here from missing sresult


You can submit these as a bug report to the author if you want - feel
free to copy-paste or link to this post :-)

- zeph



More information about the Python-list mailing list