Bug 435761 - vim leaves behind /tmp/cscope.NNNN directories
Summary: vim leaves behind /tmp/cscope.NNNN directories
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: vim   
(Show other bugs)
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
: 443952 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-03 18:48 UTC by Ralph Siemsen
Modified: 2008-04-24 10:57 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-17 17:22:47 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Ralph Siemsen 2008-03-03 18:48:55 UTC
Description of problem:
Using Vim with default .vimrc and the cscope package installed, causes
directories /tmp/cscope.NNNN to be left behind after Vim exits.  (NNNN is the
process ID).  This is apparently a bug in Vim, not cscope:

http://groups.google.com/group/vim_dev/browse_thread/thread/8651ddaa124dc6c5

After many such directories have appeared, Vim will occasionally spit out the
following error on startup (actually from cscope):

Error detected while processing /etc/vimrc:
line   32:
cs_read_prompt EOF: Illegal seek
E609: Cscope error: cscope: Could not create private temp dir /tmp/cscope.11195

This is due to the directory already existing from a previous run.  In order to
fully resolve this problem, Vim needs patching, and all existing /tmp/cscope.*
directories need to be purged.

Version-Release number of selected component (if applicable):
vim-common-7.1.211-1.fc8

How reproducible:
100%

Steps to Reproduce:
  yum install vim-enhanced
  yum install cscope
  vim <anyfile>
  ls -d /tmp/cscope.*
  
Actual results:
  Directories /tmp/cscope.* left behind when vim exits.

Expected results:
  The /tmp/cscope.* directories should be removed when vim exits.

Additional info:

Comment 1 Karsten Hopp 2008-03-04 09:34:38 UTC
upstream is aware of this and is preparing a patch:
http://news.gmane.org/find-root.php?message_id=%3c200803021233.m22CXZDu027580%40moolenaar.net%3e


Comment 2 Ralph Siemsen 2008-03-04 21:34:07 UTC
I've applied the patch mentioned in #1 (obtained from the following URL
http://article.gmane.org/gmane.editors.vim.devel/18908/raw to avoid HTML
encoding) on top vim-common-7.1.211-1.fc8 and can confirm that it solves the
problem for me.

I used the following scriptlet to cleanup the mess left in /tmp.  It takes care
not to destroy any active cscope sessions.

ls -d /tmp/cscope.* | sed -e 's#/tmp/cscope.##' | while read PID ; do
  if test -e /proc/$PID && grep -q cscope /proc/$PID/cmdline ; then
    echo Active session in /tmp/cscope.$PID ;
   else
    rm -f /tmp/cscope.$PID ;
   fi ;
done


Comment 3 Ralph Siemsen 2008-03-04 23:38:03 UTC
And of course I have a typo: we want "rm -rf" so it will remove the directory,
not just -f option.  I had put an "echo" in front of the "rm" for testing
purposes...

Comment 4 Karsten Hopp 2008-03-17 17:22:47 UTC
This is fixed in vim-7.1.281 or newer. This didn't make it into F9-Beta, but
will be in F9. In the meantime you can download packages from
http://koji.fedoraproject.org/koji/taskinfo?taskID=519581

Comment 5 Paul Bolle 2008-04-24 10:57:40 UTC
*** Bug 443952 has been marked as a duplicate of this bug. ***


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