From hdm@demon.net  Wed Jan 21 06:23:55 1998
Received: from noc.demon.net (firewall-user@server.noc.demon.net [193.195.224.4])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA27370
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Jan 1998 06:23:54 -0800 (PST)
          (envelope-from hdm@demon.net)
Received: by noc.demon.net; id OAA10127; Wed, 21 Jan 1998 14:23:48 GMT
Received: from stress.noc.demon.net(195.11.55.5) by inside.noc.demon.net via smap (3.2)
	id xmaa10115; Wed, 21 Jan 98 14:23:33 GMT
Received: from hdm by stress.noc.demon.net with local (Exim 1.80 #1)
	id 0xv18Y-0005eC-00; Wed, 21 Jan 1998 14:28:14 +0000
Message-Id: <E0xv18Y-0005eC-00.mailq@stress.noc.demon.net>
Date: Wed, 21 Jan 1998 14:28:14 +0000
From: hdm@demon.net
Reply-To: hdm@demon.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: vi dumps core
X-Send-Pr-Version: 3.2

>Number:         5537
>Category:       bin
>Synopsis:       vi dumps core with dodgy exrc file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 21 06:30:01 PST 1998
>Closed-Date:    Thu Apr 20 13:43:09 PDT 2000
>Last-Modified:  Thu Apr 20 13:46:40 PDT 2000
>Originator:     Dom Mitchell
>Release:        FreeBSD 2.2.5-STABLE i386
>Organization:
Demon Internet Ltd.
>Environment:

Nothing special needed to reproduce.

>Description:

Trying to use a pipe symbol in .exrc causes vi to core dump.

>How-To-Repeat:

Put the following line in your .exrc file:

map F :s/!/|/g

Then, do "vi foo" and watch it dump core.

>Fix:

None known of.  I gave up trying.
>Release-Note:
>Audit-Trail:

From: Bill Fenner <fenner@parc.xerox.com>
To: hdm@demon.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/5537: vi dumps core 
Date: Wed, 21 Jan 1998 09:49:43 PST

 Well, this prevents it from dumping core:
 
 --- ex/ex.c.orig	Wed Jan 21 09:24:01 1998
 +++ ex/ex.c	Wed Jan 21 09:26:30 1998
 @@ -2307,7 +2307,7 @@
  	 * underlying file, that's the real problem.
  	 */
  	if (sp->ep == NULL) {
 -		ex_emsg(sp, cp->name, EXM_NOFILEYET);
 +		ex_emsg(sp, cp ? cp->name : NULL, EXM_NOFILEYET);
  		return;
  	}
  
 but I'm not sure I get why it doesn't like the map command in the first
 place.
 
   Bill

From: Dom Mitchell <hdm@demon.net>
To: Bill Fenner <fenner@parc.xerox.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/5537: vi dumps core 
Date: Wed, 21 Jan 1998 18:20:11 +0000

 On 21 January 1998, Bill Fenner proclaimed:
 > Well, this prevents it from dumping core:
 > 
 > --- ex/ex.c.orig	Wed Jan 21 09:24:01 1998
 > +++ ex/ex.c	Wed Jan 21 09:26:30 1998
 > @@ -2307,7 +2307,7 @@
 >  	 * underlying file, that's the real problem.
 >  	 */
 >  	if (sp->ep == NULL) {
 > -		ex_emsg(sp, cp->name, EXM_NOFILEYET);
 > +		ex_emsg(sp, cp ? cp->name : NULL, EXM_NOFILEYET);
 >  		return;
 >  	}
 
 Thanks.
 
 > but I'm not sure I get why it doesn't like the map command in the first
 > place.
 
 No idea.  Here's the full macro that I was trying to get it to produce:
 
 map T 0i| ^[A |^[Yp:s/./-/g^M0r+$r+yykPj
 
 Trying to make a nice box.  However, it turned out that vi didn't like
 inserting a "|" symbol, so I tried using a substitute of the sort I gave
 to you before.  This just made it core dump.  :-)
 
 As a side note, do you have any idea whether or not we are using the
 current version of nvi?
 -- 
 Dom Mitchell  -- Demon Internet Ltd.
 hdm@demon.net -- Systems Administrator, Mail and News Team.
State-Changed-From-To: open->feedback 
State-Changed-By: wilko 
State-Changed-When: Thu Apr 20 13:10:34 PDT 2000 
State-Changed-Why:  
I just tried the 'box macro' on the vi that is part of 3.4-stable. 
No coredumps, but the following error: 

WKB ~>vi foo 
/local/home/wkb/.exrc, 1: Command failed, no file read in yet. 
/local/home/wkb/.exrc, 1: Ex command failed: pending commands discarded 

Any reason not to close the original 'core dump' PR?  

cheers, 
Wilko 
State-Changed-From-To: feedback->closed 
State-Changed-By: wilko 
State-Changed-When: Thu Apr 20 13:43:09 PDT 2000 
State-Changed-Why:  
PR submitter email bounces and coredumps have been fixed in the meantime. 
>Unformatted:
