Bug 63585

Summary: A sourced bash shell script fails with a free error
Product: [Retired] Red Hat Linux Reporter: John Crockett <crockejr>
Component: bashAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-09-26 01:56:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Crockett 2002-04-15 22:20:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
A simple script example is given below. The shell script is sourced and fails 
after the third variable assignment.

$ cat bug_source.sh
set -x

TERM=notset
TERM=vt100
TERM=vt101
TERM=vt102
TERM=vt103
TERM=vt104
TERM=vt105
TERM=vt106
$ bash
$ . ./bug_source.sh
++ TERM=notset
++ TERM=vt100
++ TERM=vt101
free: called with already freed block argument
Stopping myself...Abort 
$ 


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. source example shell script file.
2.
3.
	

Actual Results:  free: called with already freed block argument
Stopping myself...Abort 

The above error is produced and because the shell script is sourced the shell 
exits on error.

Expected Results:  You should be able to set variables as many times as you 
like.

Additional info:

Comment 1 Bernhard Rosenkraenzer 2002-04-16 11:23:14 UTC
This looks like bash doesn't handle bad termcap definitions well enough - if 
you move them around, you'll notice it crashes on setting TERM to 
 
vt101 
vt103 
vt104 
vt105 
vt106 
 
Replacing the script with an equal number of TERM settings using valid 
terminals works, e.g.: 
 
set -x 
 
TERM=notset 
TERM=vt100 
TERM=ansi 
TERM=vt102 
TERM=linux 
TERM=console 
TERM=xterm 
TERM=rxvt 
 


Comment 2 Tim Waugh 2002-10-11 11:12:12 UTC
This seems to be fixed in Red Hat Linux 8.0.