Discussion:
crash when using tmux-resurrect
Suraj N. Kurapati
2015-04-29 16:58:09 UTC
Permalink
Hello,

I'm using tmux from the master branch (which is currently pointed at
8794562a85ab7221b4ec3b165723faa8ca10db0a) from the Git repository at
<git://git.code.sf.net/p/tmux/tmux-code>.

When I run the tmux-resurrect[1] plugin's resurrect-restore
function, tmux crashes (see attached full backtrace from gdb).

This doesn't happen with 72e9ebf2ece28c986050162bf4f401a6a7679f53.

I tried git bisect to find the offending commit, but when it started
inspecting commits merged from tmux's openbsd tree (which has no
Makefile) I wasn't able to build tmux and thus couldn't run tmux to
verify whether a commit was good or bad. :(

Thanks for your consideration.

[1]: https://github.com/tmux-plugins/tmux-resurrect
Nicholas Marriott
2015-04-29 17:19:23 UTC
Permalink
This is probably fixed already in OpenBSD, you can try this:

--- cmd-find.c Tue Apr 28 10:36:13 2015
+++ /usr/src/usr.bin/tmux/cmd-find.c Wed Apr 29 00:05:40 2015
@@ -242,10 +243,13 @@ cmd_find_current_session_with_client(struct cmd_find_s
struct window_pane *wp;

/* If this is running in a pane, that's great. */
- RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
- if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
- break;
- }
+ if (fs->cmdq->client->tty.path != NULL) {
+ RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
+ if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
+ break;
+ }
+ } else
+ wp = NULL;

/* Not running in a pane. We know nothing. Find the best session. */
if (wp == NULL) {
@@ -425,7 +429,20 @@ cmd_find_get_window(struct cmd_find_state *fs, const c
fs->s = fs->current->s;

/* We now only need to find the winlink in this session. */
- return (cmd_find_get_window_with_session(fs, window));
+ if (cmd_find_get_window_with_session(fs, window) == 0)
+ return (0);
+
+ /* Otherwise try as a session itself. */
+ if (cmd_find_get_session(fs, window) == 0) {
+ if (~fs->flags & CMD_FIND_WINDOW_INDEX) {
+ fs->wl = fs->s->curw;
+ fs->w = fs->wl->window;
+ fs->idx = fs->wl->idx;
+ }
+ return (0);
+ }
+
+ return (-1);
}

/*
@@ -591,14 +608,23 @@ cmd_find_get_pane(struct cmd_find_state *fs, const cha
return (cmd_find_best_session_with_window(fs));
}

- /* Not a pane id, so use the current session and window. */
+ /* Not a pane id, so try the current session and window. */
fs->s = fs->current->s;
fs->wl = fs->current->wl;
fs->idx = fs->current->idx;
fs->w = fs->current->w;

/* We now only need to find the pane in this window. */
- return (cmd_find_get_pane_with_window(fs, pane));
+ if (cmd_find_get_pane_with_window(fs, pane) == 0)
+ return (0);
+
+ /* Otherwise try as a window itself (this will also try as session). */
+ if (cmd_find_get_window(fs, pane) == 0) {
+ fs->wp = fs->w->active;
+ return (0);
+ }
+
+ return (-1);
}

/*
Post by Suraj N. Kurapati
Hello,
I'm using tmux from the master branch (which is currently pointed at
8794562a85ab7221b4ec3b165723faa8ca10db0a) from the Git repository at
<git://git.code.sf.net/p/tmux/tmux-code>.
When I run the tmux-resurrect[1] plugin's resurrect-restore
function, tmux crashes (see attached full backtrace from gdb).
This doesn't happen with 72e9ebf2ece28c986050162bf4f401a6a7679f53.
I tried git bisect to find the offending commit, but when it started
inspecting commits merged from tmux's openbsd tree (which has no
Makefile) I wasn't able to build tmux and thus couldn't run tmux to
verify whether a commit was good or bad. :(
Thanks for your consideration.
[1]: https://github.com/tmux-plugins/tmux-resurrect
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
tmux-users mailing list
https://lists.sourceforge.net/lists/listinfo/tmux-users
Suraj N. Kurapati
2015-05-01 18:20:55 UTC
Permalink
Post by Nicholas Marriott
This is probably fixed already in OpenBSD
Thanks! I confirm that it's now fixed in git master at commit
c0cf4843e50ae7b123613798c209f30440d73e55 (merge of obsd-master).

Loading...