🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99741

Emacs and SunOS 4.1 bugs, revisited

#99741
From: Barry A. Warsaw
Date: Fri, 01 Jun 1990 16:35
235 lines
8517 bytes
>>>>> "Tony" == Tony Silva <tsilva%aaec1.UUCP@DSPVAX.MIT.EDU> writes:

Tony> I doubt this is a bug in Emacs (it's probably a Sun bug), but
Tony> I'm very sure one of you can help me work around it. I built GNU
Tony> Emacs 18.55 on a Sun-4 running Sun OS 4.1, and installed
Tony> everything. I then ran the complete Emacs image, and got the
Tony> following message:

Tony> 	Fatal error (6). IOT trap

>>>>> "William" == William Brew <bill@REASONING.COM> writes:

William> do m-x shell in the new emacs
William> you get the following message

William>    Process shell stopped (tty input)

William> and the shell does not work.


William> We have noticed some comments in the OS 4.1 release notes
William> concerning setsid and controlling terminal assignments that
William> may be related to the problem.  We have tried some
William> experiments with setsid in shell mode -- the results have
William> been inconclusive.


These two problems with emacs and SunOS 4.1 have been mentioned
previously in this newsgroup, but knowing how easy it is to miss
postings, I'll repost the solutions I snagged from this forum not too
long ago.  One caveat, I have not tested these fixes yet as we're just
upgrading our first batch of Suns to 4.1 and haven't gotten around to
rebuilding emacs on those platforms...

-Barry

======================================================================

Path: cme!uunet!bu.edu!snorkelwacker!tut.cis.ohio-state.edu!ELF.TN.CORNELL.EDU!eirik
From: eirik@ELF.TN.CORNELL.EDU
Newsgroups: gnu.emacs.bug
Subject: SunOS 4.1, malloc, and localtime
Message-ID: <9005081121.AA01868@elf.TN.Cornell.EDU>
Date: 8 May 90 11:21:46 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 28

With the enclosed patch, it is possible to build a working emacs under
SunOS 4.1 using malloc.c from the emacs sources.  Just put this line
into config.h:

#define SUNOS_LOCALTIME_BUG

A static function called by tzsetwall clears the byte just past an
eight byte region it mallocs.  Without this patch, that unsociable act
corrupts GNU malloc's memory pool.


*** malloc.c~	Fri Apr  7 22:12:10 1989
--- malloc.c	Tue May  8 07:07:22 1990
***************
*** 476,482 ****
--- 476,487 ----
       multiple of 8, then figure out which nestf[] area to use.
       Both the beginning of the header and the beginning of the
       block should be on an eight byte boundary.  */
+ #ifdef SUNOS_LOCALTIME_BUG
+   /* SunOS 4.1 localtime scribbles on the ninth byte.  */
+   nbytes = (n + ((sizeof *p + 15) & ~15) + EXTRA + 15) & ~15;
+ #else
    nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
+ #endif
    {
      register unsigned int   shiftr = (nbytes - 1) >> 2;
  

Path: cme!uunet!bu.edu!snorkelwacker!tut.cis.ohio-state.edu!ELF.TN.CORNELL.EDU!eirik
From: eirik@ELF.TN.CORNELL.EDU
Newsgroups: gnu.emacs.bug
Subject: setpgrp
Message-ID: <9005080106.AA01725@elf.TN.Cornell.EDU>
Date: 8 May 90 01:06:42 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 32

Without the enclosed patch, a shell window cannot open /dev/tty if the
parent emacs process has no controlling terminal (one way to start
such an emacs is to open an X11 window using rsh).  In SunOS 4.1, such
a shell window doesn't work at all; the shell stops immediately.

According to the SunOS 4.1 release manual, this is the right way to
detach a process from its controlling terminal, in BSD 4.3 and
earlier.  The manual explicitly states that code like the code before
this patch is no longer supported in SunOS 4.1.  It is also possible
to use setsid instead, but that way is not backward compatible.  I
don't know if the #ifndef USG is necessary here, but I doubt it can
hurt anything.


*** process.c~	Sun Aug  6 18:01:31 1989
--- process.c	Mon May  7 20:46:03 1990
***************
*** 1029,1038 ****
--- 1029,1041 ----
  	    /* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here? 
  	       I can't test it since I don't have 4.3.  */
  	    int j = open ("/dev/tty", O_RDWR, 0);
  	    ioctl (j, TIOCNOTTY, 0);
  	    close (j);
+ #ifndef USG
+ 	    setpgrp (0, 0);
+ #endif
  	  }
  #endif /* TIOCNOTTY */
  
  #if !defined (RTU) && !defined (UNIPLUS)
  /*** There is a suggestion that this ought to be a

Path: cme!uunet!tut.cis.ohio-state.edu!ocelot.llnl.gov!brown
From: brown@ocelot.llnl.gov (Dave Brown)
Newsgroups: gnu.emacs.bug
Subject: (none)
Message-ID: <9005100209.AA02829@ocelot.noname>
Date: 10 May 90 02:09:09 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 40

Apparently emacs malloc breaks on the SparcStation 1+ running SunOS 4.1.
After a normal compile run emacs:

ocelot# emacs-18.55.4*
Fatal error (6).Abort (core dumped)
ocelot# dbx *4
Reading symbolic information...
Read 29242 symbols
program terminated by signal ABRT (abort)
(dbx) run
Running: emacs-18.55.4
signal ABRT (abort) in kill at 0x5faa0
kill+8: bgeu    kill+0x18
(dbx) list
  515       abort ();
  516   #endif /* not rcheck */
  517
  518     /* Fill in the info, and if range checking, set up the magic numbers *
/
  519     p -> mh_alloc = ISALLOC;
  520   #ifdef rcheck
  521     p -> mh_nbytes = n;
  522     p -> mh_magic4 = MAGIC4;
  523     {
  524       /* Get the location n after the beginning of the user's space.  */
(dbx) where
kill() at 0x5faa0
abort() at 0x6366c
malloc(n = 7), line 515 in "malloc.c"
yp_unbind() at 0x68230
yp_get_default_domain() at 0x68270
setpwent() at 0x61da8
getpwuid() at 0x61be4
init_editfns(), line 69 in "editfns.c"
main(argc = 1, argv = 0xf7fffb8c, envp = 0xf7fffb94), line 361 in "emacs.c"
(dbx)

The apparent solution is to add:
#define SYSTEM_MALLOC
to config.h, thus bypassing the broken malloc.

Path: cme!uunet!snorkelwacker!tut.cis.ohio-state.edu!SUN.COM!peck
From: peck@SUN.COM (Jeff Peck)
Newsgroups: gnu.emacs
Subject: Re: Problems compiling 18.55 on sun4s and SunOS 4.1
Message-ID: <9005232356.AA09103@denali.sun.com>
Date: 23 May 90 23:56:57 GMT
References: <6989@timbuk.cray.com>
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 48

Since there have been two requests for this today, 
I'm broadcasting this of "info", not just "bug".

 GNU Emacs compiled on OS4.1 for Sun4 will abort with:
	Fatal error (6).Abort (core dumped)
 Backtrace will show you died in malloc.

Two workarounds for this.
The simplest, in src/config.h:

#define SYSTEM_MALLOC


	OR, consider this:


Date: Tue, 8 May 90 07:21:46 EDT
From: eirik@elf.tn.cornell.edu
To: bug-gnu-emacs@prep.ai.mit.edu
Subject: SunOS 4.1, malloc, and localtime

With the enclosed patch, it is possible to build a working emacs under
SunOS 4.1 using malloc.c from the emacs sources.  Just put this line
into config.h:

#define SUNOS_LOCALTIME_BUG

A static function called by tzsetwall clears the byte just past an
eight byte region it mallocs.  Without this patch, that unsociable act
corrupts GNU malloc's memory pool.


*** malloc.c~   Fri Apr  7 22:12:10 1989
--- malloc.c    Tue May  8 07:07:22 1990
***************
*** 476,482 ****
--- 476,487 ----
       multiple of 8, then figure out which nestf[] area to use.
       Both the beginning of the header and the beginning of the
       block should be on an eight byte boundary.  */
+ #ifdef SUNOS_LOCALTIME_BUG
+   /* SunOS 4.1 localtime scribbles on the ninth byte.  */
+   nbytes = (n + ((sizeof *p + 15) & ~15) + EXTRA + 15) & ~15;
+ #else
    nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
+ #endif
    {
      register unsigned int   shiftr = (nbytes - 1) >> 2;
Technical Details
Message-ID: <WARSAW.90Jun1123525@stella.cme.nist.gov>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cme!durer!warsaw
References: <9005311619.AA07823@aaec.uucp>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,b140956e3b9121a8
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-06-01 22:43:40 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cme!durer!warsaw
From: warsaw@cme.nist.gov (Barry A. Warsaw)
Newsgroups: gnu.emacs.bug
Subject: Emacs and SunOS 4.1 bugs, revisited
Message-ID: <WARSAW.90Jun1123525@stella.cme.nist.gov>
Date: 1 Jun 90 16:35:25 GMT
References: <9005311619.AA07823@aaec.uucp>
Sender: news@cme.nist.gov
Distribution: gnu
Organization: National Institute of Standards and Technology
Lines: 235
Posted: Fri Jun  1 17:35:25 1990
In-reply-to: tsilva%aaec1.UUCP@DSPVAX.MIT.EDU's message of 31 May 90 16:19:32 GMT