From nobody@FreeBSD.org  Tue Oct  9 08:08:13 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 9D6C337B403
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  9 Oct 2001 08:08:13 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f99F8DP06881;
	Tue, 9 Oct 2001 08:08:13 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200110091508.f99F8DP06881@freefall.freebsd.org>
Date: Tue, 9 Oct 2001 08:08:13 -0700 (PDT)
From: ulrich <ulrich@infopuls.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bash core dumps if a function called by PROMPT_COMMAND generates an error
X-Send-Pr-Version: www-1.0

>Number:         31165
>Category:       gnu
>Synopsis:       bash core dumps if a function called by PROMPT_COMMAND generates an error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 09 08:10:01 PDT 2001
>Closed-Date:    Tue Dec 4 10:52:52 PST 2001
>Last-Modified:  Tue Dec 04 10:53:23 PST 2001
>Originator:     ulrich
>Release:        4.1
>Organization:
>Environment:
FreeBSD mozart.infopuls.com 4.1-RELEASE FreeBSD 4.1-RELEASE #0: Fri Sep  8 02:29:03 CEST 2000     root@fbsdi1.infopuls.com:/usr/src/sys/compile/FBSD  i386

>Description:
If a shell function which is called by PROMPT_COMMAND returns a 
non-numeric value and generates an error message bush produces a core dump.
>How-To-Repeat:
put the following statements into a script test.bash:

function showdate(){ return `date -j "+%a%Y-%b-%d"`; }
showdate

PROMPT_COMMAND=test_prompt_command.bash

With the next prompt invocation the error message appears and the 
message about the core dump that is to be produced
>Fix:
:-(
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: tom 
State-Changed-When: Mon Nov 19 04:11:26 PST 2001 
State-Changed-Why:  
Are you running bash from /usr/ports/shells/bash1 or 
/usr/ports/shells/bash2 or have you installed bash using some other 
mechanism? 

Please give more details of the exact version of bash you are running. 


Responsible-Changed-From-To: freebsd-bugs->freebsd-ports 
Responsible-Changed-By: tom 
Responsible-Changed-When: Mon Nov 19 04:11:26 PST 2001 
Responsible-Changed-Why:  
This is most likely a ports issue 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31165 

From: Tom Hukins <tom@FreeBSD.org>
To: Ulrich <ulrich@infopuls.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: gnu/31165: bash core dumps if a function called by PROMPT_COMMAND generates an error
Date: Mon, 19 Nov 2001 14:36:27 +0000

 On Mon, Nov 19, 2001 at 01:50:17PM +0100, Ulrich wrote:
 > 
 > BASH=/usr/local/bin/bash
 > BASH_VERSINFO=([0]="2" [1]="04" [2]="0" [3]="1" [4]="release" [5]="i386--freebsd4.1")
 > BASH_VERSION='2.04.0(1)-release'
 > 
 > Is this information of any help?
 
 Yes, it looks like you're running bash2.04.  The current version in
 the Ports tree is 2.05 - I've just installed this version and the
 showdate command fails with:
   bash: return: bad non-numeric arg `Mon2001-Nov-19'
 
 It looks to me like this problem is fixed now.  Is it okay for me to
 close this PR?
 
 Tom
State-Changed-From-To: analyzed->feedback 
State-Changed-By: tom 
State-Changed-When: Wed Nov 28 12:59:14 PST 2001 
State-Changed-Why:  
Please can you confirm whether the latest version of the bash2 port 
fixes this problem?  If I don't hear from you soon, I'll assume that 
this isn't a problem with recent versions of FreeBSD as per my 
investigation. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31165 
State-Changed-From-To: feedback->closed 
State-Changed-By: tom 
State-Changed-When: Tue Dec 4 10:52:52 PST 2001 
State-Changed-Why:  
Submitter cannot reproduce problem, neither can I. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31165 
>Unformatted:
