wanderlust / semi

SEMI Development Repository for Wanderlust
http://emacswiki.org/emacs/WanderLust
40 stars 16 forks source link

set process-connection-type to nil, to fix issue with gvfs-open #5

Closed egh closed 10 years ago

egh commented 10 years ago

This fixes the issues described here:

and should have no effect on other programs.

jech commented 10 years ago

Could you please explain how using a pipe instead of a pty works around the issue of gvfs-open exiting too early?

egh commented 10 years ago

Hi Juliusz,

Thanks for looking into this. The problem is described in comment #15 here (https://bugzilla.gnome.org/show_bug.cgi?id=652262#c15):

There is a related problem also caused by gvfs-open exiting too early: if gvfs-open is run under a new pty, then it is the session group leader, and when it exits, its children are killed. There's a race condition: sometimes they can have had time to detach themselves (I've seen this happen when running gvfs-open under ltrace); other times, gvfs-open completes successfully, but the child is killed. The fix is to have gvfs-open call setsid() to put it in its own process group.

The emacs lisp manual also suggests that using process-connection-type nil is better in this case:

For subprocesses used for internal purposes by programs, it is often better to use a pipe, because they are more efficient, and because they are immune to stray character injections that ptys introduce for large (around 500 byte) messages. Also, the total number of ptys is limited on many systems and it is good not to waste them.

ikazuhiro commented 10 years ago

Merged at https://github.com/wanderlust/semi/commit/8045d8b052ec043b6d16f9840d28cc5333c27e27, but not tested.

egh commented 10 years ago

Thank you!