| Summary: | bash core dumps if a function called by PROMPT_COMMAND generates an error | ||
|---|---|---|---|
| Product: | Base System | Reporter: | ulrich <ulrich> |
| Component: | gnu | Assignee: | freebsd-ports (Nobody) <ports> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
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. Responsible Changed From-To: freebsd-bugs->freebsd-ports This is most likely a ports issue 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 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. State Changed From-To: feedback->closed Submitter cannot reproduce problem, neither can I. |
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