tmux-resurrect icon indicating copy to clipboard operation
tmux-resurrect copied to clipboard

restore crashes server (tmux 3.0)

Open tessus opened this issue 5 years ago • 17 comments

After updating tmux to 3.0, restoring ends up with a dead server and the following message: [server exited unexpectedly]

tessus avatar Nov 27 '19 00:11 tessus

PR that fixes this is very welcome

bruno- avatar Nov 27 '19 14:11 bruno-

Hi!

It works after deleting the line where window is written in tmux_resurrect_{date}.txt.

pane	0	1	:zsh	1	:*	0	:/home/user/.tmux/plugins/tmux-resurrect/scripts	1	zsh	:
pane	3	1	:zsh	1	:*	0	:/home/user/.tmux/plugins/tmux-resurrect/scripts	1	zsh	:
window	0	1	1	:*	c4de,237x55,0,0,1
window	3	1	1	:*	c4df,237x55,0,0,2
state	3	0

pane	0	1	:zsh	1	:*	0	:/home/user/.tmux/plugins/tmux-resurrect/scripts	1	zsh	:
pane	3	1	:zsh	1	:*	0	:/home/user/.tmux/plugins/tmux-resurrect/scripts	1	zsh	:
state	3	0

Isn't program related to “window” setting good?

Thank!

toshiki670 avatar Nov 27 '19 15:11 toshiki670

Hi

The issue seems to be due to window resizing in latest tmux (layout_custom.c) which is used by 'tmux select-layout' in restore.sh During the execution of the above command a decrement of 0 results in 4294967295.

When a check is inserted to decrement only when the passed value is greater than 0 , restore is working fine.

Logs (tmux 3.0):

1574867055.078107 cmdq_fire_command : (1533) select-layout -t Test-0:0 b3bd,135x32,0,0,0 1574867055.078116 cmd_find_target: target Test-0:0, type pane, item 0xfe64a0, flags NONE 1574867055.078124 cmd_find_best_session: 0 sessions to try 1574867055.078132 cmd_find_from_nothing: s=$0 Test-0 1574867055.078138 cmd_find_from_nothing: wl=0 1 w=@0 bash 1574867055.078144 cmd_find_from_nothing: wp=%1 1574867055.078150 cmd_find_from_nothing: idx=0 1574867055.078156 cmd_find_target: current is from client 1574867055.078165 cmd_find_target: target Test-0:0 is session Test-0window 0 1574867055.078177 cmd_find_get_session: Test-0 1574867055.078184 cmd_find_get_window_with_session: 0 1574867055.078191 cmd_find_target: s=$0 Test-0 1574867055.078198 cmd_find_target: wl=0 1 w=@0 bash 1574867055.078204 cmd_find_target: wp=%1 1574867055.078209 cmd_find_target: idx=0 1574867055.078225 fix layout 135,32 to 0,0 1574867055.078235 layout_parse: 0xfeba00 type WINDOWPANE [parent (nil)] wp=(nil) [0,0 135x32] 1574867055.078243 window_resize: @0 resize 4294967295x4294967295 1574867055.078251 window_pane_resize: %1 resize 4294967295x4294967295

Logs (after changes):

20067 1574868514.744013 cmdq_fire_command : (1533) select-layout -t Test-0:0 b3bd,135x32,0,0,0
20068 1574868514.744022 cmd_find_target: target Test-0:0, type pane, item 0x1c02df0, flags NONE
20069 1574868514.744030 cmd_find_best_session: 0 sessions to try
20070 1574868514.744037 cmd_find_from_nothing: s=$0 Test-0
20071 1574868514.744044 cmd_find_from_nothing: wl=0 1 w=@0 bash
20072 1574868514.744050 cmd_find_from_nothing: wp=%1
20073 1574868514.744056 cmd_find_from_nothing: idx=0
20074 1574868514.744062 cmd_find_target: current is from client
20075 1574868514.744070 cmd_find_target: target Test-0:0 is session Test-0window 0
20076 1574868514.744077 cmd_find_get_session: Test-0
20077 1574868514.744083 cmd_find_get_window_with_session: 0
20078 1574868514.744091 cmd_find_target: s=$0 Test-0
20079 1574868514.744097 cmd_find_target: wl=0 1 w=@0 bash
20080 1574868514.744103 cmd_find_target: wp=%1
20081 1574868514.744109 cmd_find_target: idx=0
20082 1574868514.744124 fix layout 135,32 to 0,0
20083 1574868514.744134 layout_parse: 0x1c012a0 type WINDOWPANE [parent (nil)] wp=(nil) [0,0 135x32]
20084 1574868514.744143 window_resize: @0 resize 135x32
20085 1574868514.744153 recalculate_sizes: @0 is 135,32

Thanks

DarkKnight288 avatar Nov 27 '19 15:11 DarkKnight288

nice catch. do you plan on making an MR upstream with the bounds check? if not I can throw something together.

julie-is-late avatar Nov 27 '19 17:11 julie-is-late

seems it's fixed on tmux/master anyways in https://github.com/tmux/tmux/commit/2cb268d51b71d74cf32e9cd1f67892681a9563e1 :)... guess we just wait.

julie-is-late avatar Nov 27 '19 18:11 julie-is-late

Can we workaround in tmux-resurrect while waiting for the release? My workstation setup is completely busted right now.

kugel- avatar Nov 28 '19 06:11 kugel-

I failed on this too :-(

zx1986 avatar Nov 28 '19 07:11 zx1986

tmux-arch.tar.gz

I created an arch linux package with the mentioned fix (https://github.com/tmux/tmux/commit/2cb268d51b71d74cf32e9cd1f67892681a9563e1). run makepkg to compile from source or use the binary package directly.

resurrect doesn't crash with this.

kugel- avatar Nov 28 '19 09:11 kugel-

For AUR users, the tmux-git package also fixes this and might be a suitable workaround until a release lands in the main repos. Will require manually keeping track of that, though, since tmux-git conflicts with tmux and will require removing it.

wizonesolutions avatar Nov 28 '19 15:11 wizonesolutions

Hi, until this is fixed, if using brew to install tmux, you can downgrade to 2.9a like this:

brew uninstall tmux
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c8cff106b17b90472cc6e251b9e5c2daf4fd8d46/Formula/tmux.rb

This installs tmux 2.9a. To prevent from upgrading (until this is fixed), pin the version:

brew pin tmux

To unpin and upgrade:

brew unpin tmux
brew upgrade tmux

Hologos avatar Nov 28 '19 19:11 Hologos

Incidentally, the official arch linux package was updated today containing this (and other) fixes. (https://git.archlinux.org/svntogit/community.git/commit/?h=packages/tmux&id=0cf4db848ce50803fea0d2c22d0545a7434a79f0)

kugel- avatar Nov 28 '19 22:11 kugel-

Ok, not a plugin issue. I guess we can close this issue, although it would make sense to either

  • leave it open for a week
  • close it and pin the issue for a while

tessus avatar Nov 29 '19 02:11 tessus

Until there's an official tmux fix (I think nicm plans a hotfix release), I've added the fix to MacPorts.

tessus avatar Nov 29 '19 21:11 tessus

3.0a changelog

n8henrie avatar Dec 01 '19 15:12 n8henrie

I am still running into a related crash, in spite of a tmux version that should have this fix, when using nix's home-manager. More details in https://github.com/tmux-plugins/tmux-resurrect/issues/473

n8henrie avatar Jul 24 '23 20:07 n8henrie

To people experience this issue, have you tried removing old restore data?

bjornfor avatar Jul 24 '23 20:07 bjornfor

Yes -- it works as a one-time fix (as does just removing the window lines as per above) but the problem recurs soon thereafter.

n8henrie avatar Jul 24 '23 21:07 n8henrie