Bug#397830: xsabre: It does _not_ work on powerpc

2006-11-16 Thread Cyril Brulebois
"Steinar H. Gunderson" <[EMAIL PROTECTED]> (16/11/2006):
> The original submitter was using powerpc; you are using i386. That's
> quite probably related...

Hi,

I confirm I can reproduce this bug on powerpc. I'll be happy to help
debugging it.

Cheers,

-- 
Cyril Brulebois

PS: I'm now on-list.


pgppNZ7ORvUKe.pgp
Description: PGP signature


Bug#397830: xsabre: It does _not_ work on powerpc

2006-11-16 Thread Steinar H. Gunderson
On Thu, Nov 16, 2006 at 10:54:03PM +0100, Cyril Brulebois wrote:
> I confirm I can reproduce this bug on powerpc. I'll be happy to help
> debugging it.

Well, it sure sounds like an endianness problem to me. For starters, try
running it in gdb and print the backtrace?

/* Steinar */
-- 
Homepage: http://www.sesse.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#397830: xsabre: It does _not_ work on powerpc

2006-11-16 Thread Steinar H. Gunderson
On Thu, Nov 16, 2006 at 11:18:47PM +0100, Steinar H. Gunderson wrote:
> Well, it sure sounds like an endianness problem to me.

Looks like I was right. src/txtrmap.C, line 218:

  fread(&map_w,sizeof(map_w),1,f);
  fread(&map_h,sizeof(map_h),1,f);
  fread(&n,sizeof(n),1,f);

Fixing this specific case is of course trivial; just replace it by

  unsigned char tmp[4];

  fread(tmp, 4, 1, f);
  map_w = tmp[0] | (tmp[1] << 8) | (tmp[2] << 16) | (tmp[3] << 24);

  fread(tmp, 4, 1, f);
  map_h = tmp[0] | (tmp[1] << 8) | (tmp[2] << 16) | (tmp[3] << 24);

  fread(tmp, 4, 1, f);
  n = tmp[0] | (tmp[1] << 8) | (tmp[2] << 16) | (tmp[3] << 24);

but there are at least 8-10 more of these cases, and also the same in fwrite
form. Basically, this doesn't seem to be endian-clean at all; given that the
package has been in Debian since at least woody and nobody has cared, perhaps
not all that big of a loss? (IOW: Perhaps it should simply be requested
removed for big-endian architectures?)

/* Steinar */
-- 
Homepage: http://www.sesse.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]