🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87715

[19.25] fatal bug in init_cmdargs()

#87715
From: Darrell Kindred
Date: Sun, 04 Sep 1994 03:00
40 lines
1997 bytes
Do the following (interrupt emacs within a couple seconds or it'll eat
up all available memory):
	mkdir /tmp/foo /tmp/bar /tmp/bar/etc /tmp/bar/lib-src
	ln -s <your-path-to-emacs> /tmp/foo/emacs
        ln -s emacs /tmp/foo/emacslink
	/tmp/foo/emacslink
On at least linux 1.1.18 (Slackware 2.0), this causes emacs 19.25 to spin,
eating memory (the startup screen never appears).

The bug will be triggered any time that the emacs executed is a
relative symlink, emacs doesn't find etc and lib-src under
invocation-directory or invocation-directory's parent, and it does
find etc and lib-src in the current directory.  Under these
conditions, init_cmdargs() will try to invoke (file-name-as-directory nil),
which, for reasons I haven't looked into, seems to cause an infinite
loop of alternating throw() and catch().

The bug is fixed by the patch below.

- Darrell

*** src/emacs.c.orig	Sat May 28 00:44:47 1994
--- src/emacs.c	Sun Sep  4 02:14:46 1994
***************
*** 255,261 ****
  	  if (!NILP (tem))
  	    {
  	      name = tem;
! 	      dir = Ffile_name_directory (name);
  	    }
  	  else
  	    break;
--- 255,261 ----
  	  if (!NILP (tem))
  	    {
  	      name = tem;
! 	      dir = Ffile_name_directory (Fexpand_file_name (name, dir));
  	    }
  	  else
  	    break;
Technical Details
Message-ID: <25900.778647474@GS13.SP.CS.CMU.EDU>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cmu.edu!dkindred+

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,b4e8b94702270f5e,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-09-03 20:07:11 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!cmu.edu!dkindred+
From: dkindred+@cmu.edu (Darrell Kindred)
Newsgroups: gnu.emacs.bug
Subject: [19.25] fatal bug in init_cmdargs()
Date: 3 Sep 1994 23:00:11 -0400
Organization: GNUs Not Usenet
Lines: 40
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <25900.778647474@GS13.SP.CS.CMU.EDU>