[Bug 928900] Re: Segmentation fault with associative arrays

Daniel Manrique daniel.manrique at canonical.com
Wed Feb 8 15:24:01 UTC 2012


Confirmed with importance: Medium as it is "A bug that has a moderate
impact on a core application. "

This script will reproduce (I changed the associative array's key to
"baz" to avoid confusion with the function name (foo)).

TEST CASE:

Run the following BASH script:

#!/bin/bash
function foo {
    declare -A hash
    declare hash[baz]=bar #bash crashes here
}

foo


Expected result:
nothing, but not a crash either

Actual result:
Segmentation fault

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/928900

Title:
  Segmentation fault with associative arrays

Status in “bash” package in Ubuntu:
  Confirmed

Bug description:
  If we write code like:

  function foo {
      declare -A hash
      declare hash[foo]=bar #bash crashes here
  }

  Bash crashes when calling this function.  The same exact code works as
  expected if it's not in a shell function.

  Additional details:

  $ lsb_release -rd
  Description:	Ubuntu 11.10
  Release:	11.10
  $ apt-cache policy bash
  bash:
    Installed: 4.2-0ubuntu4
    Candidate: 4.2-0ubuntu4
    Version table:
   *** 4.2-0ubuntu4 0
          500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main amd64 Packages
          100 /var/lib/dpkg/status

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/928900/+subscriptions




More information about the foundations-bugs mailing list