[comp.emacs] gnu emacs 18.53 patches

jr@bbn.com (John Robinson) (04/11/89)

The following should be readily available to anyone trying to bring up
GNU emacs version 18.53.  These bugs keep nailing people, leading to
complaints to the lists, leading to ...  If you are a distribution
point, please pick this file up (and maybe apply the patches if you
can) to cut down the ongoing chatter.  Please trim the trailing
signature, thanks.

By the way, I tried to put this onto prep, only to find that it is no
longer where the domain system says it is, replaced by a machine known
as aeneas.  If this is the rumored demise of prep, RIP.  'Twas a noble
servant to us all.

/jr
--------
Version 18.53 has two widely-reported bugs.  The first, the setpgrp()
bug in emacs.c, causes a lot of systems to have trouble when emacs is
called from other programs, including shell scripts.  The second, the
realloc() bug in malloc.c, causes assorted bus errors, segmentation
violations, and other indications of wild memory references.
Following are the patches.
------------------------------------------------------------------------
*** emacs.c-18.53	Tue Apr 11 10:48:43 1989
--- emacs.c	Fri Aug 26 18:31:50 1988
***************
*** 225,233 ****
  #endif HIGHPRI
  
- #ifdef BSD
-   /* interrupt_input has trouble if we aren't in a separate process group.  */
-   setpgrp (getpid (), getpid ());
- #endif
- 
    inhibit_window_system = 0;
  
--- 225,228 ----
*** malloc.c-18.53	Fri Feb 24 15:44:33 1989
--- malloc.c	Mon Feb 27 11:16:21 1989
***************
*** 578,584 ****
    register int nunits;
  
!   if ((p = (struct mhead *) mem) == 0)
      return malloc (n);
!   p -= (8 / sizeof (struct mhead));
    nunits = p -> mh_index;
    ASSERT (p -> mh_alloc == ISALLOC);
--- 578,584 ----
    register int nunits;
  
!   if (mem == 0)
      return malloc (n);
!   p = (struct mhead *) (mem - ((sizeof *p + 7) & ~7));
    nunits = p -> mh_index;
    ASSERT (p -> mh_alloc == ISALLOC);
***************
*** 598,602 ****
  
    /* See if desired size rounds to same power of 2 as actual size. */
!   nbytes = (n + sizeof *p + EXTRA + 7) & ~7;
  
    /* If ok, use the same block, just marking its size as changed.  */
--- 598,602 ----
  
    /* See if desired size rounds to same power of 2 as actual size. */
!   nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
  
    /* If ok, use the same block, just marking its size as changed.  */
------------------------------------------------------------------------
/jr
jr@bbn.com or bbn!jr
C'mon big money!