Bug 31165

Summary: bash core dumps if a function called by PROMPT_COMMAND generates an error
Product: Base System Reporter: ulrich <ulrich>
Component: gnuAssignee: freebsd-ports (Nobody) <ports>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description ulrich 2001-10-09 16:10:01 UTC
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.

Fix: 

:-(
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
Comment 1 Tom Hukins freebsd_committer freebsd_triage 2001-11-19 12:11:26 UTC
State Changed
From-To: open->analyzed

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. 


Comment 2 Tom Hukins freebsd_committer freebsd_triage 2001-11-19 12:11:26 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ports

This is most likely a ports issue
Comment 3 Tom Hukins freebsd_committer freebsd_triage 2001-11-19 14:36:27 UTC
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
Comment 4 Tom Hukins freebsd_committer freebsd_triage 2001-11-28 20:59:14 UTC
State Changed
From-To: analyzed->feedback

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.
Comment 5 Tom Hukins freebsd_committer freebsd_triage 2001-12-04 18:52:52 UTC
State Changed
From-To: feedback->closed

Submitter cannot reproduce problem, neither can I.