[Debian GNUstep maintainers] Bug#362192: bus error in autogsdoc on
some architectures
Jurij Smakov
jurij at wooyd.org
Sat Apr 22 03:33:07 UTC 2006
Hi,
On sparc this clearly looks like an alignment problem. The decode()
function mentioned in the backtrace above is supposed to do the right
thing depending on whether alignment on word boundary for ints is
required. The need for such alignment is tested during 'configure' run and
is recorded in NEED_WORD_ALIGNMENT variable in Source/config.h (and other
places probably). The problem is that on sparc this test is not triggered
as it should, so the NEED_WORD_ALIGNMENT is set to zero.
The test performed by 'configure' consists of compiling and executing the
config/config.align.c program, where some intentional unaligned accesses
are performed. If it fails, then the platform requires alignment and
NEED_WORD_ALIGNMENT is set to 1. The problem is that when built with -O2
(as 'configure' does), the program does not fail, the compiler appears to
do something smart about it and unaligned accesses are avoided whatsoever:
testj at debian:~/gorm/gnustep-base-1.11.2$ gcc -O2 config/config.align.c -o align.test
config/config.align.c: In function 'main':
config/config.align.c:18: warning: incompatible implicit declaration of built-in function 'exit'
jurij at debian:~/gorm/gnustep-base-1.11.2$ ./align.test
jurij at debian:~/gorm/gnustep-base-1.11.2$
If built without optimization, the program bus-errors, as intended:
jurij at debian:~/gorm/gnustep-base-1.11.2$ gcc config/config.align.c -o align.test
config/config.align.c: In function 'main':
config/config.align.c:18: warning: incompatible implicit declaration of built-in function 'exit'
jurij at debian:~/gorm/gnustep-base-1.11.2$ ./align.test
Bus error
jurij at debian:~/gorm/gnustep-base-1.11.2$
Compiler used in both tests:
jurij at debian:~/gorm/gnustep-base-1.11.2$ gcc --version
gcc (GCC) 4.0.3 (Debian 4.0.3-1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So, I guess it's really up to upstream to come up with a better test, or
make sure that the test binary is built without optimization. A possible
temporary workaround would be to somehow force NEED_WORD_ALIGNMENT to 1 on
sparc. After I've done it and installed the resulting debs, gorm.app has
built without problems.
Best regards,
Jurij Smakov jurij at wooyd.org
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
More information about the pkg-GNUstep-maintainers
mailing list