setsid() causes select() to block forever after forking

14 views
Skip to first unread message

björn

unread,
Jun 17, 2010, 1:21:16 PM6/17/10
to vim_mac, nicola...@gmx.de
Hi vim_mac readers (and Nico in particular),

In the process of investigating Issue 271 [1] (using zsh leads to
reproducible hang with fugitive.vim) I found that the lockup only
happens if the "-f" flag is _not_ used (i.e. the hang only occurs if
MacVim forks). Not only that, if I do not call setsid() before
forking the lockup goes away.

Can anybody tell me what the point of setsid() is before forking?
(Apparently it is there so the process survives if the parent is
terminated, but I found that if I exit the shell that I started MacVim
from the Vim process keeps going even if setsid() is not called.) Is
it safe to remove this call?

Also, does anybody have any idea why the setsid() would cause Vim to
lock up? I've traced the problem and the process locks after a call
to select() (which never returns). I don't at all see the connection
here, maybe somebody else does (Nico: since you wrote the forking code
I was hoping you'd have something to say about this?).

Thanks,
Björn

[1] http://code.google.com/p/macvim/issues/detail?id=271

Reply all
Reply to author
Forward
0 new messages