Bug 1074202 - Regression in variable nesting
Summary: Regression in variable nesting
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Oprala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-08 21:14 UTC by Zdenek Kabelac
Modified: 2016-02-01 02:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-01 08:52:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zdenek Kabelac 2014-03-08 21:14:27 UTC
Description of problem:

Here is simple bash script which used to work in pre 4.3 era:
(Noticed from failing lvm2 test suite)

--

#!/bin/bash

pass_() {
	declare -a var=("${!1}")
	echo "Size ${#var[*]}"
	printf "%s\n" "${var[@]}"
}

var=( "a" )
pass_ "var[@]"

--
Output with 4.3:
Size 0

--
Output with bash-4.2.45-6.fc21.x86_64
Size 1
a
--

Obvious workaround is to use different name with 'declare -a var'
but looks like serious regression in variable name processing in bash


Version-Release number of selected component (if applicable):
bash-4.3.0-1.fc21.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Ondrej Oprala 2014-03-10 10:55:13 UTC
Thank you for reporting this. A similar issue (if I'm not mistaken) was already reported on the upstream ML - http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00049.html . It doesn't seem like a deliberate regression, so hopefully it'll catch their attention soon.

Comment 2 Ondrej Oprala 2014-04-01 08:52:07 UTC
Although a regression, this now seems to be the correct behaviour and won't be changed back. Please see [1] for a solution/rationale of this problem.

[1] http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00052.html


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