[omniORB] Re: Endian problems

Patrick Hartling patrick.hartling at gmail.com
Thu Aug 3 12:40:58 BST 2006


On 8/3/06, Duncan Grisby <duncan at grisby.org> wrote:
> On Wednesday 2 August, "Patrick Hartling" wrote:
>
> [...]
> > If the client tries to connect to the server using a stringified
> > object reference, I get a SequenceIsTooLong marshaling exception from
> > within IOP::IOR::unmarshaltype_id(). Tracing into it, I find that the
> > sequence length is supposed to be 32, but the byte order does not get
> > swapped correctly, thus causing omniORB to think that the sequence is
> > supposed to be much, much longer. This happens when the client is big
> > endian and the server is little endian and vice versa. If the
> > endianness matches for both machines, then there are no problems.
>
> Byte-swapping certainly normally works. I've tried experiments with a
> Sparc machine talking to an x86 machine, and it works fine. Whatever is
> going wrong is more subtle than simply that it doesn't do the
> byteswapping. What kinds of machines are you using, and how did you
> build omniORB for them?

I see the problems when trying to connect between my PowerBook G4 and
both of my desktop machines. The PowerBook runs Mac OS X 10.4.7. One
desktop machine is an x86 running Windows XP and Fedora Core 5. The
other is an x86_64 machine running Red Hat Enterprise Linux 4 x86_64
with all the latest updates.

For Mac OS X and Linux, I use the configure-based build and do not
give it any special options other than an installation prefix. For
Windows, I use the older build system that involves editing
config/config.mk.

> Could it perhaps be that on one of the machines
> the build system thought it was little endian but it's actually
> big-endian, or vice-versa?  That would mean it didn't swap when it was
> meant to.

Yes, that is certainly possible. AFAICT, omniORB correctly determines
the endianness of the little endian machines. I came to that
conclusion while tracing through the code executing on the x86_64
machine and looking at the state of variables related to byte
swapping. I have not done the same sort of examination on the PowerPC
machine. The configure script for omniORB 4.0.7 reports the correct
endianness, and acconfig.h defines WORDS_BIGENDIAN correctly. Is there
anywhere else I should look?

 -Patrick


-- 
Patrick L. Hartling
http://www.137.org/patrick/



More information about the omniORB-list mailing list