[Spread-users] size_t problem in spread on 64bit platforms

Melissa Jenkins melissa-spread at temeletry.co.uk
Thu Jul 1 05:09:23 EDT 2010

Just in case anybody has been trying to run Spread on 64bit boxes.

I have had all sorts of strange problems sending UDP messages on FreeBSD 8 with the amd64 kernel.  Sometimes they would go, sometimes not, often the Spread network groups would not form and the Spread daemons would not talk to each other.

I believe I have traced them down to scatter.h defining an iovec equivalent that is size 'int'.  According to configure output int is 4 bytes.  According to the man pages for iovec the sizes are size_t, which is 8 bytes.

changing scatter.h to the following:

/* scat_element is EXACTLY as defined in iovec */

typedef struct dummy_scat_element{
       char    *buf;
       size_t  len;
} scat_element;

typedef struct dummy_scatter {
       size_t          num_elements;
       scat_element    elements[ARCH_SCATTER_SIZE];
} sys_scatter;

typedef struct dummy_big_scatter {
       size_t          num_elements;
       scat_element    elements[MAX_SCATTER_ELEMENTS];
} scatter;

#endif  /* INC_SCATTER */

Seems to work a lot better :)  I have been using this in for a couple of weeks and the groups can form :)  I'd think a more portable change would be to use a typedef iovec dummy_scat_element on platforms with iovec and using the existing definition on ones that don't.


PS: spread at spread.org seems to bounce

More information about the Spread-users mailing list