On Thu, Jul 26, 2007 at 02:03:23PM +0200, Gerfried Fuchs wrote:
>  I guess the trying to allocate huge parts of memory might be related to
> an endianness problem within the .dat file.  Is the dat file format
> documented somehwere?  Maybe someone able to do so wants to check that
> code for endianness problems in that area?

You are right, indeed.  The offending code is in packfile.h (PackFile1::Read):

        int size;
        fseek(f, -(int)sizeof(size), SEEK_END);
        int end_offset = ftell(f); fread(&size, sizeof(size), 1, f);
        fseek(f, end_offset - size, SEEK_SET);

Obviously, size needs to be transformed to host endianness after reading
it.  Also, it seems broken because it uses sizeof(size).  This means
that on 64bit architectures, it will read the last 8 bytes of the file.
Since the file itself is in arch-all, and thus not rebuilt, this cannot
be correct.

Sorry I'm not attaching a patch, but with this info it shouldn't be too
hard for someone else to write one.

Hope that helps,
Bas

-- 
I encourage people to send encrypted e-mail (see http://www.gnupg.org).
If you have problems reading my e-mail, use a better reader.
Please send the central message of e-mails as plain text
   in the message body, not as HTML and definitely not as MS Word.
Please do not use the MS Word format for attachments either.
For more information, see http://pcbcn10.phys.rug.nl/e-mail.html

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Pkg-games-devel mailing list
Pkg-games-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-games-devel

Reply via email to