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

Bug#333766: libc6: SIGBUS in libm on hppa breaks qt-x11-free

Daniel Jacobowitz a écrit :
On Fri, Oct 14, 2005 at 05:59:33AM +0200, Aurelien Jarno wrote:

Ok, that's mean that theoretically it would break the ABI, but practically, it does not break the ABI as the alignment is the same (otherwise we would also have noticed SIGBUS in other applications).

Said in other words, applications with 4-byte aligned fenv_t variables are not working (SIGBUS), so it won't hurt to break the ABI in that case, as the applications have to be rebuilt anyway to fix the problem.

Whichever you like then.  I would appreciate it if someone could come
up with a patch for one or the other, or at least an authoritative
statement and I'll sort the code out in the morning; I have the next
glibc upload otherwise ready.

I have attached a patch that changes the alignment of the f_env type. I have tested it separately from the glibc, it works. However, I would prefer that some people have a look to the asm code of the glibc to see what can be done.

Oh yes, BTW, I have seen that glibc does not built anymore on hppa. It seems the new binutils does not accept some assembly instructions. Currently I am doing my tests with binutils 2.16.1. It has to be fixed before uploading a new glibc, but unfortunately I don't speak hppa assembly.

  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net
#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Description: Change type fenv_t type to 8 byte alignment, so
#		   that it can be access with 64-bit instructions.
# DP: Related bugs: 
# DP: Dpatch author: Aurelien Jarno <aurel32@debian.org> 
# DP: Patch author: Aurelien Jarno <aurrel32@debian.org> 
# DP: Upstream status:
# DP: Status Details: 
# DP: Date: 2005-08-03


if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p$PATCHLEVEL < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p$PATCHLEVEL < $0;;
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
exit 0

# append the patch here and adjust the -p? flag in the patch calls.
--- sysdeps/hppa/fpu/bits/fenv.h.orig	2001-07-06 06:55:52.000000000 +0200
+++ sysdeps/hppa/fpu/bits/fenv.h	2005-10-14 06:09:22.246387881 +0200
@@ -67,7 +67,7 @@
   unsigned int __status_word;
   unsigned int __exception[7];
-} fenv_t;
+} __attribute__((aligned(8))) fenv_t;
 /* If the default argument is used we use this value.  */
 #define FE_DFL_ENV ((fenv_t *) -1)

Reply to: