From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 12056 invoked from network); 4 Feb 2000 02:10:11 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 4 Feb 2000 02:10:11 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id VAA28718 for ; Thu, 3 Feb 2000 21:10:10 -0500 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id TAA14950 for axp-list@redhat.com; Thu, 3 Feb 2000 19:10:08 -0700 From: Michal Jaegermann Message-Id: <200002040210.TAA14950@ellpspace.math.ualberta.ca> Subject: Emacs from RH 6.1 throwing unaligned access - solved To: axp-list@redhat.com Date: Thu, 3 Feb 2000 19:10:08 -0700 (MST) X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ok, I found that bugger at last. Don't even try to ask me how much time I spent exploring blind alleys (it looked for a while as a weird ncurses library bug) as I am ashamed even to admit. :-) Below is a bug description from the stuff I submitted to bugzilla.redhat.com. A file emacs-20.4/src/ChangeLog includes the following entry: 1997-07-28 Richard Stallman ........................ * cm.h, sysdep.c, terminfo.c [HAVE_LIBNCURSES]: Declare ospeed as short, unless NCURSES_OSPEED_T. Unfortunately nothing in 'configure' for emacs seems to be checking for that. The net effect is that emacs declares 'ospeed' as 'short' while libraries, which access the same global variable, treat that as 'speed_t'. At least with ncurses-4.2-25, as included in RH 6.1 distribution, these two types are not the same. On Alpha, in particular, this has an effect of generating "unaligned access" messages from a kernel on every access from libraries to that variable. In general it seems that this version of binaries for emacs works more by a sheer luck than anything else as some not entirely random memory is clobbered on every write and a garbage retrieved on reads. This can be fixed by adding NCURSES_OSPEED_T to compilation flags in emacs.spec file and recompiling emacs binaries. A patch to spec file is included below. So, here is a recipe to fix the problem: - install emacs sources (rpm -i emacs-20.4-4.src.rpm) - cd /usr/src/redhat/SPECS and 'patch -p1 < ....' using the patch below (you can use this whole message for that) - type 'rpm -ba emacs.spec' and wait for a while (various development tools and libraries have to be installed for that to succeed) - install what you need from resulting rpm files which you will find in /usr/src/redhat/RPMS/alpha This will solve that problem. If somebody with a handy RH 6.1 installation on ev4 machine (so this will be ok for all processors around) wants to submit recompiled binaries to ftp.alphalinux.org - go ahead. Michal ========================================================================= --- SPECS/emacs.spec.orig Sat Sep 25 07:55:28 1999 +++ SPECS/emacs.spec Thu Feb 3 17:17:37 2000 @@ -2,7 +2,7 @@ Name: emacs %define version 20.4 Version: %{version} -Release: 4 +Release: 4hd Copyright: GPL Group: Applications/Editors Source0: ftp://ftp.gnu.org/pub/gnu/emacs-%{version}.tar.gz @@ -91,8 +91,8 @@ find . -name "*.orig" -exec rm -f {} \; %build -PUREDEF="" -XPUREDEF="" +PUREDEF="-DNCURSES_OSPEED_T" +XPUREDEF="-DNCURSES_OSPEED_T" libtoolize --force --copy CONFOPTS="--prefix=/usr --libexecdir=/usr/lib --sharedstatedir=/var --with-gcc --with-pop" @@ -296,6 +296,12 @@ %config(missingok) /etc/X11/applnk/Applications/emacs.desktop %changelog +* Thu Feb 3 2000 Michal Jaegermann +- added missing, as per emacs Changelog, NCURSES_OSPEED_T compilation + flag; without it emacs on Linux is making global 'ospeed' short which + is not the same as 'speed_t' expected by libraries. + Unfortunately current 'configure' does not pick up that. + * Sat Sep 25 1999 Preston Brown - added desktop entry