[Stackless] Patch for pickle problem on 64bit platforms

Kristján Valur Jónsson kristjan at ccpgames.com
Fri Oct 19 13:53:24 CEST 2007

This is because the variables i and n on the cframe are of type "long".
Now, this type is 64 bit long on 64 bit linux, but it remains 32 bits on 64 bit Windows.
What is this used for?  Is there a reason this is "long" and not "int"?
Should we perhaps use Py_SSIZE_T instead which is consistently 64 bits on 64 bit windows and unix?

One should avoid types such as "long" on code that is supposed to work identically on windows and unix.


-----Original Message-----
From: stackless-bounces at stackless.com [mailto:stackless-bounces at stackless.com] On Behalf Of Hallgrimur H. Gunnarsson
Sent: Wednesday, October 17, 2007 01:23
To: stackless at stackless.com
Subject: [Stackless] Patch for pickle problem on 64bit platforms

Hi all,

The following patch fixes the pickle problem on 64bit platforms:


This problem was causing all pickle-related unit test to fail with
a message like:

"cannot execute invalid frame [..]: frame had a C
state that can't be restored."

(or see http://hhg.to/pickle-fix.txt for example output).

The problem was caused by a PyArg_ParseTuple int/long size
misalignment in cframe_setstate (core/cframeobject.c).

-- Hallgrimur

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list