Hi Bram,


Whether vim exits by itself, or by a caught signal, or by an uncaught signal, 
cscope exits always.



For example, when TERM is sent to vim, the following is the ‘strace –p’ on 
cscope:

strace -p 4017

Process 4017 attached - interrupt to quit

read(0, "q\n", 4096)                    = 2

unlink("/tmp/cscope.4017/cscope.1")     = -1 ENOENT (No such file or directory)

unlink("/tmp/cscope.4017/cscope.2")     = -1 ENOENT (No such file or directory)

rmdir("/tmp/cscope.4017")               = 0

exit_group(0)                           = ?

Process 4017 detached



When KILL is sent to vim:

strace -p 14083

Process 14083 attached - interrupt to quit

read(0, "", 4096)                       = 0

unlink("/tmp/cscope.14083/cscope.1")    = -1 ENOENT (No such file or directory)

unlink("/tmp/cscope.14083/cscope.2")    = -1 ENOENT (No such file or directory)

rmdir("/tmp/cscope.14083")              = 0

exit_group(0)                           = ?

Process 14083 detached



Since cscope is handling EOF on its stdin correctly, this patch should be fine 
I think. Anyway sending this patch to vim-dev for further comments.



Regards,

Naren (Narendran Gopalakrishnan.)





-----Original Message-----
From: Bram Moolenaar [mailto:[email protected]]
Sent: Sunday, June 09, 2013 2:00 AM
To: Gopalakrishnan, N
Subject: Re: Patch for "E262: error reading cscope connection 0."





Naren -



> Have another patch for an issue that has been a minor irritant for too

> long. vim uses the command line interface of cscope - for this it

> simply forks and exec's cscope, so cscope still belongs to the process

> group that has the controlling terminal. So whenever the vim's window

> is resized (happens to me frequently as my window sizes between office

> and home are different), a SIGWINCH is sent to cscope also.

> Unfortunately, cscope doesn't expect it (as it is running in command

> line mode) and crashes (a cscope bug strictly speaking, and I guess it

> should simply ignore SIGWINCH in command line mode.) It is easy to see

> this issue by using 'strace -p <cscopePid>' from another terminal,

> after adding a cscope.out in vim.

>

> But vim can help out by simply changing the pgid of the child before

> exec. This prevents SIGWINCH being sent to cscope in the first place.

> Attached the patch.



Thanks.  A disadvantage is that when exiting Vim, Cscope keeps on running, 
right?  Maybe only when Vim exists in response to a signal.



I suggest you send this patch to the Vim-dev maillist, so others can have a 
look and say what they think.



- Bram



--

hundred-and-one symptoms of being an internet addict:

115. You are late picking up your kid from school and try to explain

     to the teacher you were stuck in Web traffic.



/// Bram Moolenaar -- [email protected]<mailto:[email protected]> -- 
http://www.Moolenaar.net   \\\

///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\

\\\  an exciting new programming language -- http://www.Zimbu.org        ///

\\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Attachment: vim_E262.patch
Description: vim_E262.patch

Raspunde prin e-mail lui