persistent module does not use Py_ssize_t

Bug #153316 reported by Gerald Klix
4
Affects Status Importance Assigned to Milestone
ZODB
Status tracked in 3.9
3.8
Fix Released
Medium
Christian Theune
3.9
Fix Released
Medium
Christian Theune

Bug Description

cPersistence.c and cPickleCache.c do not use Py_ssize_t for calls to PyDict_Next.
This leads to persistent objects without attributes, when they are loaded.

Revision history for this message
Gerald Klix (gerald-klix) wrote :

The following diff (from svn) fixes the bug for me.

HTH,
Gerald

Revision history for this message
shane (shane-3continents) wrote :

The same problem is also present in the BTrees module. It manifests itself in various ways, like slicing not working correctly.

I have attached a patch for the BTrees module. It needs the "#if PY_VERSION_HEX" like the other patch and typedefs for the other new types (lenfunc, ssizeargfunc, etc.) to work with older python versions. I felt that this code is better put in some common place instead of being copy & pasted into each file (but not sure where that is).

All tests pass with both patches applied.

Shane

Revision history for this message
Christian Theune (ctheune) wrote :

Can you please explain a bit more when this happens? Best would be to provide a test case that provokes the error.

Changed in zodb:
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 153316] Re: persistent module does not use Py_ssize_t

The problem here is that existing tests fail, but only on (some) 64-
bit systems. :(

No *new* test case is needed.

Jim

On Nov 9, 2007, at 8:14 AM, Christian Theune wrote:

> Can you please explain a bit more when this happens? Best would be to
> provide a test case that provokes the error.
>
> ** Changed in: zodb
> Importance: Undecided => Medium
> Status: New => Incomplete
>
> --
> persistent module does not use Py_ssize_t
> https://bugs.launchpad.net/bugs/153316
> You received this bug notification because you are a member of Zodb-
> developers, which is the registrant for ZODB.

--
Jim Fulton
Zope Corporation

Revision history for this message
Christian Theune (ctheune) wrote :

Am Freitag, den 09.11.2007, 13:28 +0000 schrieb Jim Fulton:
> The problem here is that existing tests fail, but only on (some) 64-
> bit systems. :(

Do we know which? I'll try some of the 64-bit systems later but it would
be good to know where they fail.

--
gocept gmbh & co. kg - forsterstrasse 29 - 06112 halle (saale) - germany
www.gocept.com - <email address hidden> - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Revision history for this message
Jim Fulton (jim-zope) wrote :

On Nov 9, 2007, at 9:25 AM, Christian Theune wrote:

>
> Am Freitag, den 09.11.2007, 13:28 +0000 schrieb Jim Fulton:
>> The problem here is that existing tests fail, but only on (some) 64-
>> bit systems. :(
>
> Do we know which? I'll try some of the 64-bit systems later but it
> would
> be good to know where they fail.

No. I asked the original poster on zodb-dev but I don't remember
seeing a reply, although I might have missed it. BTW, I'm assuming
that this is a 64-bit issue because the tests passed for me on the 32-
bit systems I tested against.

Jim

--
Jim Fulton
Zope Corporation

Revision history for this message
Christian Theune (ctheune) wrote :

The patches look ok. I'm reorganising the Python 2.4 compatibility (thanks to Gregoire Weber for some C knowledge).

Changed in zodb:
assignee: nobody → ct-gocept
status: Incomplete → In Progress
Revision history for this message
Christian Theune (ctheune) wrote :

Btw: It's reproducable on this machine for me:

Linux uter 2.6.12-gentoo-r6 #1 SMP Sun Aug 21 19:27:51 CEST 2005 x86_64 Intel(R) Xeon(TM) CPU 2.80GHz GenuineIntel GNU/Linux

Revision history for this message
Christian Theune (ctheune) wrote :

Fixed on the trunk using a cleaned-up version of the patches. Passes on 32-bit and 64-bit Xeon.

Revision history for this message
Christian Theune (ctheune) wrote :

Fixed in r81758.

Revision history for this message
Christian Theune (ctheune) wrote :

Released in 3.8.0c1

Revision history for this message
whit morriss (whit-openplans) wrote :

I'm seeing something simular to this on Ubuntu 64-bit machines against the current 3.8.9b egg. will drive to derive more a replicable test

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.