[Zope-dev] RE BUG: IntSet.c:229 (fwd)

Anthony Pfrunder s341625@student.uq.edu.au
Wed, 16 Jun 1999 18:01:53 +1000 (GMT+1000)


---------- 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