---------- Forwarded message ---------- Date: Wed, 16 Jun 1999 11:40:42 +1000 (GMT+1000) From: Anthony Pfrunder <s341625@student.uq.edu.au> To: zope-dev@zope.org Subject: BUG: IntSet.c:229 Hi, This is a followup to the IntSet.c:229 bug. It only segfaults on Win32, not linux. It appears to be due to the fact that the self->size attribute of the IntSet Extension Class is not initalised when an instance is initalised. This can be verified by putting printf("Len: %i, Size: %i, Ptr: %p",self->len, self->size, self); at the top of the int_insert method (line ~200). This causes the (paraphased...) if ((self->size >= i) && (int_grow(self, data, l))) ... to short circuit and hence the uninitalised self->data is never allocated (in int_grow). Hence, in the int_modify call it segfaults by deref'ing data (*data = ikey) to a random location. IntSet appears to have cPersistence.c as its superclass (see Import statements in initInt) but I cannot find where the actual initalisation is done (cPersistence doesn't have one either!!??). Could those with much better knowledge of the Components directory of Zope2 and Extension Classes in general help me out? The source I am using is the win32 source patch for Zope 2.0.0a2 released yesterday. Contact me for the zip file or it may be @ Contrib on Zope. Cheers, Anthony Pfrunder PS Please cc replies to s341625@student.uq.edu.au thanx
Anthony Pfrunder wrote:
---------- Forwarded message ---------- Date: Wed, 16 Jun 1999 11:40:42 +1000 (GMT+1000) From: Anthony Pfrunder <s341625@student.uq.edu.au> To: zope-dev@zope.org Subject: BUG: IntSet.c:229
Hi,
This is a followup to the IntSet.c:229 bug. It only segfaults on Win32, not linux.
I'll look at this and see if I can reproduce it.
It appears to be due to the fact that the
self->size
attribute of the IntSet Extension Class is not initalised when an instance is initalised. This can be verified by putting
printf("Len: %i, Size: %i, Ptr: %p",self->len, self->size, self);
at the top of the int_insert method (line ~200).
What values are you seeing?
This causes the (paraphased...)
if ((self->size >= i) && (int_grow(self, data, l))) ...
to short circuit and hence the uninitalised self->data is never allocated (in int_grow). Hence, in the int_modify call it segfaults by deref'ing data (*data = ikey) to a random location.
IntSet appears to have cPersistence.c as its superclass (see Import statements in initInt) but I cannot find where the actual initalisation is done (cPersistence doesn't have one either!!??).
When an ExtensionClass is created, it's data are initialized to NULL, so all menbers should be zero.
Could those with much better knowledge of the Components directory of Zope2 and Extension Classes in general help me out?
Yes, I'll check it out. This is very strange. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
Anthony Pfrunder wrote:
This is a followup to the IntSet.c:229 bug. It only segfaults on Win32, not linux. It appears to be due to the fact that
(snip) It's due to the fact that you are getting the ZODB 2 intSet rather than the ZODB 3 intSet. You need to build the BTree modules and the intSet module in lib/python/ZopeZODB3. The Setup in this directory arranges for the BTree and intSet modules to be built using the ZODB cPersistence.h rather than the BoboPOS version. I got Zope 2 with ZODB 3 working on Windows today, but there still seem to be some problems I need to work on. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Anthony Pfrunder -
Jim Fulton