Re: Problems with Backhand on Compaq DS10L (alpha) w/ Redhat 7.2

"Theo E. Schlossnagle" <[email protected]> Thu, 03 Jul 2003 12:21:43 -0400
Newsgroups gmane.comp.apache.mod-backhand.general
Organization Center for Networking and Distributed Systems
Message-ID <[email protected]>
Leonardo Herrera wrote:
> (I'm not sure if this message was sent, so I'm sending it again. Sorry 
> for any inconvenience)
> 
> Hi. I'm trying to use Backhand on a Compaq DS10L (alpha) running Redhat
> 7.2. I have already a setup working, thanks to the help of Theo; but
> now, when I try to add another machine (mentioned above) it shows its
> values corrupted. A wild guess: Are you mapping a stream of bytes
> directly to a structure? If so, I wrote a little program that prints the
> sizeof's of the different types present in serverstat. Here's the output
> 
> Alpha:
> [root@bateria17 leus]# cat /proc/cpuinfo |grep platform
> platform string         : AlphaServer DS10L 617 MHz
> [root@bateria17 leus]# ./a.out
> serverstat: 112
> time_t: 8
> sockaddr_in: 16
> int: 4
> 
> Intel:
> leus@desarrollo:~/test> cat /proc/cpuinfo |grep "model name"
> model name      : AMD Duron(tm) processor
> leus@desarrollo:~/test> ./a.out
> serverstat: 104
> time_t: 4
> sockaddr_in: 16
> int: 4

Yes... alpha has an 8 byte time_t.  intel has 4 bytes.  However, there is an 8 
byte padding in the structure... it must be an alignment issue.  I have a 
Linux Alpha box sitting around here somewhere, if you don't puzzle it out 
before me, then I'll figure it out.

Essentially, what we sould do is make sure that all the internal elements of 
that structure are aligned on an 8 byte boundary.  There is some clever 
compiler directive to do that, but it escapes me now.

-- 
Theo Schlossnagle
Principal Consultant
OmniTI Computer Consulting, Inc. -- http://www.omniti.com/
Phone:  +1 410 872 4910 x201     Fax:  +1 410 872 4911
1024D/82844984/95FD 30F1 489E 4613 F22E  491A 7E88 364C 8284 4984
2047R/33131B65/71 F7 95 64 49 76 5D BA  3D 90 B9 9F BE 27 24 E7