🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99790

Re: emacs18.55 on hpux7.0

#99790
From: Piet van Oostrum
Date: Tue, 01 May 1990 16:29
56 lines
3008 bytes
There is a problem in the alloca.s as distributed in the GNU emacs src
directory on HP/UX.

The alloca() copies part of the user's stack, because it could contain the
saved registers and it has to be moved for the corresponding restore. Now
the code in alloca uses the instruction 
	mov.l	(%a1)+,(%sp)+
to copy the block. This means that part of the block falls temporarily
outside the stack, thus being susceptible to corruption should a signal
trap occur.

Since my last patch to emacs which introduced a 1 second interval timing
interrupt I had several problems with emacs, such as error messagesILLEGAL
DATATYPE, stack underflow in byte_code, segmentation violations and bus
errors. Andy Norman <ange@hplb.hpl.hp.com> also experienced this kind of
problem, but he reported that occasionally he had the same problems before
the patch. So this might well be this alloca() problem. Anyway, here is a
patch. Note that this problem will not occur if you compile emacs with gcc.


*** alloca.s.~1~	Fri Sep 15 16:35:39 1989
--- alloca.s	Tue May  1 17:18:08 1990
***************
*** 92,103 ****
  	sub.l	&MAXREG*4,%d1	# space for saving registers
  	mov.l	%d1,%sp		# save new value of sp
  	tst.b	PROBE(%sp)	# create pages (sigh)
  	move.w	&MAXREG-1,%d0
  copy_regs_loop:			/* save caller's saved registers */
! 	mov.l	(%a1)+,(%sp)+
  	dbra	%d0,copy_regs_loop
! 	mov.l	%sp,%d0		# return value
! 	mov.l	%d1,%sp
  	add.l	&-4,%sp		# adjust tos
  	jmp	(%a0)		# rts
  #endif /* new hp assembler */
--- 92,105 ----
  	sub.l	&MAXREG*4,%d1	# space for saving registers
  	mov.l	%d1,%sp		# save new value of sp
  	tst.b	PROBE(%sp)	# create pages (sigh)
+ 	mov.l	%a2,%d1		# save reg a2
+ 	mov.l	%sp,%a2
  	move.w	&MAXREG-1,%d0
  copy_regs_loop:			/* save caller's saved registers */
! 	mov.l	(%a1)+,(%a2)+
  	dbra	%d0,copy_regs_loop
! 	mov.l	%a2,%d0		# return value
! 	mov.l	%d1,%a2		# restore a2
  	add.l	&-4,%sp		# adjust tos
  	jmp	(%a0)		# rts
  #endif /* new hp assembler */
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31-30-531806   Uucp:   uunet!mcsun!ruuinf!piet
Telefax:   +31-30-513791   Internet:  piet@cs.ruu.nl   (*`Pete')
Technical Details
Message-ID: <3133@ruuinf.cs.ruu.nl>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!ruuinf!piet
References: <2504@syma.sussex.ac.uk> <3109@ruuinf.cs.ruu.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,cf4d66f65ac7015f
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-05-01 15:31:28 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!ruuinf!piet
From: piet@cs.ruu.nl (Piet van Oostrum)
Newsgroups: gnu.emacs.bug
Subject: Re: emacs18.55 on hpux7.0
Keywords: interrupt, X11, emacs, hpux
Message-ID: <3133@ruuinf.cs.ruu.nl>
Date: 1 May 90 16:29:57 GMT
References: <2504@syma.sussex.ac.uk> <3109@ruuinf.cs.ruu.nl>
Sender: news@ruuinf.cs.ruu.nl
Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
Organization: Dept of Computer Science, Utrecht University, The Netherlands
Lines: 56
Posted: Tue May  1 17:29:57 1990
In-reply-to: piet@cs.ruu.nl (Piet van Oostrum)