[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-bugs] tiger hash alignment bug on Solaris/sparc

From: Gabriel Forté
Subject: [Mldonkey-bugs] tiger hash alignment bug on Solaris/sparc
Date: Mon, 9 Feb 2004 22:06:08 +0100
User-agent: Mutt/1.5.4i


I found a runtime problem when running MLDonkey 2.5.9 on Solaris/sparc
(reproduced with solaris 9 and solaris 10b37 on UltraSparc II machines).

in tiger.c:static_tiger(), the rec[3] array may not start on a 64bit
boundary, causing an early bus error at the startup of the mlnet binary,
due to an unaligned memory access.

I kickly devised a dirty workaround to this problem in tiger_hash().
It's quite surely not the right place and the right way to do this,
but it seems to work so far for me...
The startup messages didn't even mention that my machine couldn't
compute tiger trees correctly as it did in earlier versions of MLDonkey
(the last one I checked was 2.5-4)

void tiger_hash(char prefix, char *s, int len, unsigned char *digest)
  char *buffer = (char*) tiger_buffer;
  word64 ndigest[3];

  buffer[0] = prefix;
  memcpy(buffer +1, s, len);

  memcpy(ndigest, digest, 3 * sizeof(word64));
  static_tiger(tiger_buffer, (len +1), (word64*) (ndigest));
  memcpy(digest, ndigest, 3 * sizeof(word64));



Gabriel Forté

reply via email to

[Prev in Thread] Current Thread [Next in Thread]