remove command can fail for addons, contains possible infinite loop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim-addon-manager (Debian) |
Fix Released
|
Unknown
|
|||
vim-addon-manager (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Won't Fix
|
Undecided
|
Daniel T Chen | ||
Maverick |
Won't Fix
|
Undecided
|
Daniel T Chen | ||
Natty |
Won't Fix
|
Undecided
|
Daniel T Chen | ||
Oneiric |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
SRU Impact statement:
The Ruby script addon-manager.rb contains an error in the code for the remove command. This bug causes certain addons where the ~/.vim directory is actually a symbolic link to another directory. This is the case for the Vim R plugin, distributed as a Debian package here:
http://
Removal will fail because it attempts to invoke a rmdir on the symbolically-linked ~/.vim file, which causes a Ruby exception.
Patch / Resolution:
The problem is that the while-loop on line 66 is written "while paths.size", which, in Ruby, will always evaluate to be true, because even the value "0" is considered true in Ruby. See:
http://
Were it not for a fluke exception-handling within the loop, and exception raising in the case when the ~/.vim directory is a symbolic link, this would actually result in an infinite-loop. The loop should be changed to "while paths.size > 0".
The fixed version is already available in Oneiric (0.4.3ubuntu1), and the patch has been forwarded to Debian.
Patch for natty-proposed: https:/
Patch for maverick-proposed: https:/
Patch for lucid-proposed: https:/
TEST CASE:
Steps to reproduce the behavior:
1) Install vim-addon-manager
2) Install the Vim R plugin DEB package from http://
3) Move the ~/.vim folder to another location, such as ~/vimbak
4) Create a temporary folder ~/tmpvim
5) Create a symbolic link with "ln -s ~/tmpvim ~/.vim"
6) Run "vim-addons install r-plugin"
7) Run "vim-addons remove r-plugin"
8) Observe an error message like the following
Info: removing installed addon 'r-plugin' from /home/chris/.vim
/usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/lib/
from /usr/bin/
from /usr/bin/
Regression risk:
Slim to none. The patch does not affect other code paths.
From the original bug description:
This bug affects the upstream Debian package of vim-addon-manager, too.
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: vim-addon-manager 0.4.3
ProcVersionSign
Uname: Linux 2.6.38-8-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Sat Jun 25 16:24:17 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
PackageArchitec
ProcEnviron:
LC_TIME=
LANGUAGE=en_US:en
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: vim-addon-manager
UpgradeStatus: Upgraded to natty on 2011-04-30 (56 days ago)
tags: | added: patch |
tags: |
added: patch-forwarded-debian removed: patch |
Changed in vim-addon-manager (Debian): | |
status: | Unknown → New |
Changed in vim-addon-manager (Debian): | |
status: | New → Fix Released |
tags: | added: testcase |
Changed in vim-addon-manager (Ubuntu Maverick): | |
status: | Fix Committed → Won't Fix |
Changed in vim-addon-manager (Ubuntu Natty): | |
status: | Fix Committed → Won't Fix |
tags: | added: removal-candidate |
Here is a patch that should be applied to the file addon-manager.rb
The patch fixes the errant while-loop.