Bug 63585 - A sourced bash shell script fails with a free error
A sourced bash shell script fails with a free error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-15 18:20 EDT by John Crockett
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-09-25 21:56:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Crockett 2002-04-15 18:20:22 EDT
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 07:23:14 EDT
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 07:12:12 EDT
This seems to be fixed in Red Hat Linux 8.0.

Note You need to log in before you can comment on or make changes to this bug.