Comment 5 for bug 149527

Revision history for this message
Alberto Bertogli (albertito) wrote :

I hit this bug too, on amd64, after upgrading to gutsy beta.

This is a simple testcase:

 1. Put the following in a file named bash-bug.sh:
     -----8<-----
       echo 1
      {
              ROVAR="this variable is read only"
      } || .
      echo 2
      readonly ROVAR
      echo 3
    -----8<-----

    Note the "{ ... } || ." trick is exactly the same as the one at
    the beginning of /etc/bash_completion
 2. Run it once, sourced, like:
       $ source bash-bug.sh
    You should see it print up to 3.
 3. Run it again, in the same shell, like before.
     Now, here is where it differs: in ubuntu7, it works (it complains
     about ROVAR being read only, but it prints up to 3). In
     ubuntu11, it stops after the error.

If you were to "source bash-bug.sh" from a bash script (or, in the
common case, .bashrc or .profile), it would stop its execution too.

Now, I wanted to track the regression, so I took a look at ubuntu's
diff.gz, and noticed "upstream patch 20" which looked very
suspicious.

I then generated my own ubuntu11 package _without_ upstream
patch 20 (but all the others), and it worked just fine.

So I think patch 20 is causing this bug.

As a workaround, you can also avoid the variables readonly in
/etc/bash_completion.

If this patch is really upstream, I guess it should be reported. Should
I do it?

If the patch is correct (regardless of its upstream status), then
/etc/bash_completion needs to be fixed somehow.

Thanks a lot,
    Alberto