bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[50 character or so descriptive subject here (for reference)] core dump


From: jperkyns
Subject: [50 character or so descriptive subject here (for reference)] core dumps on nested function calls in loop
Date: Sat, 6 Jan 2001 14:21:11 -0600 (CST)

Configuration Information [Automatically generated, do not change]:
Machine: alpha
OS: osf4.0b
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DHOSTTYPE='alpha' -DOSTYPE='osf4.0b' 
-DMACHTYPE='alpha-dec-osf4.0b' -DSHELL  -DHAVE_CONFIG_H   -I. -I. -I./lib -g -O2
uname output: OSF1 Ra V4.0 1229 alpha
Machine Type: alpha-dec-osf4.0b

Bash Version: 2.02
Patch Level: 0
Release Status: release

Description:
   When when func2 is called repeatedly from func1 it core dumps on the 3rd
   attempt.  It happens with bash 2.02.?? and 2.04.?? on OSF1 4.0b, 4.0d,
   4.0f and 5.0a (I tried all combinations).  Below is the simplest code I 
   can find which exhibits the problem.  It runs as expected (10 loops, exit)
   on an i586 Linux box.
   The output on the alphas is:

   In func2 for the 1 time
   In func2 for the 2 time
   Segmentation fault (core dumped)

Repeat-By:

# Here's the sample 
#
func1(){
   declare -i i=0
   while [ $i -lt 10 ]; do
      let i=$i+1
      func2
   done
}

func2(){ echo "In func2 for the $i time"; }

func1
# End of sample

Fix:
   I only have a workaround.
   Inlining (by hand) the line from func2 into func1 makes it go away.
   Maybe it's a stack handling problem?  



reply via email to

[Prev in Thread] Current Thread [Next in Thread]