Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Emacs from RH 6.1 throwing unaligned access - solved
Date: Thu, 3 Feb 2000 19:10:08 -0700 (MST)	[thread overview]
Message-ID: <200002040210.TAA14950@ellpspace.math.ualberta.ca> (raw)

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  <rms@psilocin.gnu.ai.mit.edu>
........................
        * 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 <michal@harddata.com>
+- 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 <pbrown@redhat.com>
 - added desktop entry
 


                 reply	other threads:[~2000-02-04  2:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox