bus error and check fail on solaris 2.6

Remi Guyomarch rguyom at mail.dotcom.fr
Mon Feb 22 23:00:02 CET 1999

On Mon, Feb 22, 1999 at 04:53:03PM +0900, Koichi Inoue wrote:
> Hi,
>   I compiled GPG 0.9.3 successfully on solaris 2.6 (sparc).
> It seems working well, but there is some suspicous things.
> 1.  When I executed `make checks' in the GPG top directory, it
>       failed in 9 places. Some test failed with bus error.
> 2.  When I mistakenly typed `gpg README' (it may not be work), gpg

GnuPG is not ready for Sparc yet, due to numerous mis-aligned memory

For example, the first failed test is on mds.test, where a bus error
occurs in tiger.c, due to a 8-byte memory write to a 4-byte aligned
pointer. A fast fix for this error might be (in cipher/md.c) :
(this assumes sizeof(char*) == sizeof(int) == sizeof(size_t) == 4)

  struct md_digest_list_s {
      struct md_digest_list_s *next;
      const char *name;
      int algo;
      byte *asnoid;
      int asnlen;
      int mdlen;
      void (*init)( void *c );
      void (*write)( void *c, byte *buf, size_t nbytes );
      void (*final)( void *c );
      byte *(*read)( void *c );
      size_t contextsize; /* allocate this amount of context */
+     char __alignment[4]; /* align context[] on a 8-byte boundary */
      char context[1];

There is other bugs like this one. The next one is a bus error in
md5.c. I'm tracing them. More later...

PS: Why can't we use a simple malloc() for variable-size buffers,
contexts, etc ... malloc() will give us properly aligned pointers

Rémi        <rguyom at mail.dotcom.fr> | Don't waste your computer's time :
    PGP-encrypt anything important: | http://www.distributed.net/
   www.gnupg.org - KeyID:0x85BD8B1B | http://www.distributed.net/cores/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : /pipermail/attachments/19990222/70abce9d/attachment.bin

More information about the Gnupg-devel mailing list