Discussion:
[tmux:tickets] #164 some directory file descriptors are not closed
ajs124
2014-11-01 15:53:45 UTC
Permalink
---

** [tickets:#164] some directory file descriptors are not closed**

**Status:** open
**Created:** Sat Nov 01, 2014 03:53 PM UTC by ajs124
**Last Updated:** Sat Nov 01, 2014 03:53 PM UTC
**Owner:** nobody

Hey,

so I hit this bug which frequently prevents me from unmounting drives, because tmux has open file descriptors for directories on them.
Those file descriptors are evidently not needed anymore, because I can attach gdb to the tmux process, close them manually and tmux works fine afterwards.

My tmux version is 1.9_a on arch linux.
No idea if it is relevant, but I attached my .tmux.conf


---

Sent from sourceforge.net because tmux-***@lists.sourceforge.net is subscribed to https://sourceforge.net/p/tmux/tickets/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/tmux/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
Balazs Kezes
2014-11-29 20:28:35 UTC
Permalink
Post by ajs124
so I hit this bug which frequently prevents me from unmounting drives,
because tmux has open file descriptors for directories on them.
Those file descriptors are evidently not needed anymore, because I can
attach gdb to the tmux process, close them manually and tmux works
fine afterwards.
I've also hit this bug recently, it's quite annoying. After a quick scan
of the code, it seems that a directory is open for each client, session
and pane. I think the pane one might be the most annoying and it really
seems the code isn't using it for anything. I've attached a patch for
removing the per pane open cwd.
--
Balazs
Nicholas Marriott
2014-11-30 08:06:13 UTC
Permalink
Post by Balazs Kezes
Post by ajs124
so I hit this bug which frequently prevents me from unmounting drives,
because tmux has open file descriptors for directories on them.
Those file descriptors are evidently not needed anymore, because I can
attach gdb to the tmux process, close them manually and tmux works
fine afterwards.
I've also hit this bug recently, it's quite annoying. After a quick scan
of the code, it seems that a directory is open for each client, session
and pane. I think the pane one might be the most annoying and it really
seems the code isn't using it for anything. I've attached a patch for
removing the per pane open cwd.
<snip>
Post by Balazs Kezes
- if (fchdir(wp->cwd) != 0)
+ if (fchdir(cwd) != 0)
chdir("/");
This is where it is used. -1 is passed into window_pane_spawn by
cmd-respawn-*.c.
Post by Balazs Kezes
if (tcgetattr(STDIN_FILENO, &tio2) != 0)
Loading...