[Uim] uim gtk2 input method leaks fd and crashes nautilus

TOKUNAGA Hiroyuki tkng at xem.jp
Fri Mar 19 23:54:10 EET 2004


Hi,

On Fri, 19 Mar 2004 17:34:54 +0100
Frederic Crozat <fcrozat at mandrakesoft.com> wrote:

> With Michael Meeks's help, I was able to fix Mdk bug
> http://qa.mandrakesoft.com/show_bug.cgi?id=8607 (and I've also filled
> a bug upstream on GNOME :
> http://bugzilla.gnome.org/show_bug.cgi?id=137519
> ).
(snip)           
>       open_max = sysconf (_SC_OPEN_MAX);
>       for (i = 3; i < open_max; i++)
>          fcntl (i, F_SETFD, FD_CLOEXEC);

Thanks for your patch and advice. I applied your patch. To tell the
truth, I didn't know about FD_CLOEXEC at all and still don't understand
why it's need. (Is simply closing all of the file descriptors not
enough?) I must learn more about them.

Before calling execlp, I inserted following:

    open_max = sysconf (_SC_OPEN_MAX);
    for (i = 3; i < open_max; i++) {
      set_cloexec(i);      
    }

(set_cloexec is the function to set the flag FD_CLOEXEC)

I hope it is what you mean.


Regards,

-- 
TOKUNAGA Hiroyuki
http://kodou.net/




More information about the uim mailing list