[Spread-users] Portability bug on SOLARIS 8, sparcv9 (64-bit)

James Rauser j.rauser at science-factory.com
Thu Nov 7 05:10:12 EST 2002


Hello,

I just ran into a problem compiling spread on 64-bit Solaris 8 (sparcv9).
In scatter.h, the structure "scat_element" is defined as:

	/* scat_element is EXACTLY as defined in iovec */
	typedef struct dummy_scat_element{
		char	*buf;
		int	len;
	} scat_element;

The comment is important pointers to arrays of scat_element are cast
to (struct iovec *) and plugged into the msg.msg_iov pointer
(struct msghdr) in DL_send().

But: on Solaris, struct iovec uses "size_t" for the length field, and
on sparcv9, int is 32 bits and size_t is 64.  Ooops...  This causes
the sendmsg() calls in DL_send to fail with EMSGSIZE, with the result
that clients don't get any messages.

This happens in both 3.16.2 and 3.17.0.

I changed the len field to use "size_t" and the daemon appears to work
normally after a few basic tests.

I was surprised by this because a search through the mailing list
archives turns up several messages which claim to have spread running
on 64-bit sparc and Linux Alpha without problems.  Is spread "officially"
tested on 64-bit architectures?

Greetings, Jim

-- 
------------------------------------------------------------------------
Jim Rauser                                          Science Factory GmbH
mailto:j.rauser at science-factory.com                       Unter Käster 1
Tel: +49 221 277 399 204                          50667 Cologne, Germany




More information about the Spread-users mailing list