[sldev] Endian bug in 1.15.0.2 message template reader?

Paul TBBle Hampson Paul.Hampson at Pobox.com
Sun May 13 17:14:41 PDT 2007


I'm seeing a problem (posted to the Linux Alpha Client forum [1]) with
my PowerPC build of the 1.15.0.2 Linux client, which does not happen on
an AMD64 build of the same source.

Basically, when logging in, I get a bunch of logRanOffEndOfPacket error
from an ObjectUpdate, followed by the following error:

WARNING: processParcelOverlay: Got parcel overlay size 4 expecting 1024

The significance of the above error is that in 16-bits, 4 byteswaps to
1024 (0x0004 => 0x0400). This combined with the fact that it doesn't
happen on AMD64 is why I think there's a byteswapping bug.

The message template for ParcelOverlay is:

// ParcelOverlay
// We send N packets per region to the viewer.
// N = 4, currently.  At 256x256 meter regions, 4x4 meter parcel grid,
// there are 4096 parcel units per region.  At N = 4, that's 1024 units
// per packet, allowing 8 bit bytes.
// sim -> viewer
// reliable
{
    ParcelOverlay Low Trusted Zerocoded
    {
        ParcelData      Single
        {   SequenceID  S32             }   // 0...3, which piece of region
        {   Data        Variable    2   }   // packed bit-field, (grids*grids)/N
    }
}

I guess my first question is, what's that '2' mean? It seems to be
defined as 'size' during the template reading process, but I've not
yet been able to work out what it's used for... I'm _hoping_ it turns
out to be "size will be encoded in a 16-bit word" in which case the
fix will be as easy as "find the code that reads the size off the
network, and byteswap it if it's reading anything longer than 1".

I guess this also assumes that the SL network protocol is little-endian.

Given that Mac OS X runs on PowerPC too, I figured there'd be some
byteswapping logic for it, but I couldn't find any relevant defines
in llmessage's source.

I'd also appreciate any other suggestions as to what might be going
wrong. I'm on the Orientation Island, in case there's something special
about it.

Interestingly, I didn't have this problem with the 1.14.0.1 build,
or the 1.14.1.0 build.

[1] http://forums.secondlife.com/showthread.php?t=183218

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, B.Sc, LPI, MCSE
On-hiatus Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.Com

Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
 -- Kristian Wilson, Nintendo, Inc, 1989

License: http://creativecommons.org/licenses/by/2.1/au/
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.secondlife.com/pipermail/sldev/attachments/20070514/15be7029/attachment.pgp


More information about the SLDev mailing list