[ZCM] [ZC] 1130/ 6 Comment "Spread Module bug"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Tue Jan 27 11:28:29 EST 2004


Issue #1130 Update (Comment) "Spread Module bug"
 Status Accepted, Database/bug+solution medium
To followup, visit:
  http://zope.org/Collectors/Zope/1130

==============================================================
= Comment - Entry #6 by tim_one on Jan 27, 2004 11:28 am

I apologize for not having reviewed this already.  Alas, I can't make it a priority this week either.

Note that on the Spread mailing list, and very recently (over the past few days), other cases of bus errors were uncovered when people changed these #define's, but in Spread internals.  Jonathan Stanton said those are fixed in Spread CVS now, for the (eventual) 3.17.2 release.
________________________________________
= Comment - Entry #5 by termim on Jan 27, 2004 11:05 am

Tim,

Any chance to review the patch?
________________________________________
= Comment - Entry #4 by termim on Nov 24, 2003 9:38 am


Uploaded:  "spreadmodule.c.patch2"
 - http://zope.org/Collectors/Zope/1130/spreadmodule.c.patch2/view
Ok, there is take two
________________________________________
= Assign - Entry #3 by tim_one on Nov 21, 2003 12:45 pm

 Status: Pending => Accepted

 Supporters added: tim_one

I agree the code now works (or fails) by accident.  Adding in sizeof(int) at random places isn't really better, though, so I'm not going to apply the patch as-is.

A correct fix appears to require using the additional Spread API functions SP_get_gid_offset_memb_mess(), SP_get_num_vs_offset_memb_mess(), and SP_get_vs_set_offset_memb_mess().

I believe these were introduced in Spread 3.17, and were introduced precisely because you can't decode the absurdly complicated SP_receive's return buffer reliably without them.

If you can work up a patch using those correctly, I'd be happy to apply it.
________________________________________
= Edit - Entry #2 by ajung on Nov 21, 2003 9:10 am

 Changes: submitter email, importance (critical => medium)
________________________________________
= Request - Entry #1 by termim on Nov 20, 2003 8:12 pm


Uploaded:  "spreadmodule.c.patch"
 - http://zope.org/Collectors/Zope/1130/spreadmodule.c.patch/view
spreadmodule.c contains improper use of the 'sizeof' operator
(see 6.5.3.4 [#3]  http://std.dkuug.dk/jtc1/sc22/open/n2794/n2794.txt )
which results in a bug (Spread Module loses all extra membership information)
when Spread Toolkit's constant MAX_GROUP_NAME (sp.h) is not divisible by 4.

To reproduce this problem you set the MAX_PRIVATE_NAME and MAX_PROC_NAME
values in the Spread toolkit to 64 and MAX_GROUP_NAME to 130 (64+1+64+1),
recompile spread library and spread module and then run testspread.py.
You will get something like:
======================================================================

FAIL: testSingleConnect (__main__.SpreadTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "testspread.py", line 87, in testSingleConnect
    "expected one mbox to cause the join")
  File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/unittest.py", line 286, in failUnlessEqual
    raise self.failureException, \
AssertionError: expected one mbox to cause the join

----------------------------------------------------------------------
Ran 11 tests in 1.399s

FAILED (failures=1)

The patch attached fixes the problem.


==============================================================




More information about the Zope-Collector-Monitor mailing list