Mailing List Archive

Problems with Backhand on Compaq DS10L (alpha) w/ Redhat 7.2
(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


Regards,
--
Leonardo Herrera
mailto:lherrera@certifica.com
Problems with Backhand on Compaq DS10L (alpha) w/ Redhat 7.2 [ In reply to ]
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
Problems with Backhand on Compaq DS10L (alpha) w/ Redhat 7.2 [ In reply to ]
Theo E. Schlossnagle wrote:
> 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.

Ok, I played a bit with the code. I cloned the serverstat struct and
added the __attribute__ ((__packed__)) directive. Unsurprisingly, the
results on the intel machine did not changed. In the alpha machine,
sizeof(serverstat) decreased from 112 bytes (unaligned) to 108 bytes
(aligned.) It's needed to deal with the extra 4 bytes from time_t?

Anyways, I'm going to try with just this change.

Regards,
--
Leonardo Herrera
mailto:lherrera@certifica.com