Mailing List Archive

bus error and check fail on solaris 2.6
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
stopped with bus error, other than any error message.

The information may be too little. I can send the output of `make checks'.

--
****************************************
Koichi Inoue Ricoh co. ltd.
Information and Communication R&D Center
e-mail: kinoue@ic.rdc.ricoh.co.jp
Re: bus error and check fail on solaris 2.6 [ In reply to ]
Koichi Inoue <kinoue@ic.rdc.ricoh.co.jp> writes:

> 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
> stopped with bus error, other than any error message.

Okay, I have noticed that there are a couple of bus errors and I
think the reason will all be the same.


--
ceterum censeo RSA esse delendam
Re: bus error and check fail on solaris 2.6 [ In reply to ]
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
access.

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
everytime.

--
RĂ©mi <rguyom@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/
Re: bus error and check fail on solaris 2.6 [ In reply to ]
Remi Guyomarch <rguyom@mail.dotcom.fr> writes:

> + char __alignment[4]; /* align context[] on a 8-byte boundary */
> char context[1];

Right. I have to use either an union of some types, use a type which
fulfills all alignment requests or use memcpy to access the variable
in the contect :-)

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

Because we would then need 2 mallocs. I think I broke this thing some
time ago. I'm going to fix this tomorrow.

Thanks,

Werner

--
ceterum censeo RSA esse delendam