New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmux 2.6-2 crashdumps when starting neovim 0.2.2-2 #1264

Closed
module0x90 opened this Issue Feb 21, 2018 · 16 comments

Comments

6 participants
@module0x90

module0x90 commented Feb 21, 2018

Hi,

I just noticed that when I start nvim in a tmux session it closes immediately. The logs says it crash dumped:

Feb 21 12:00:02 XXX systemd-coredump[11259]: Process 11058 (tmux: server) of user 1000 dumped core.

                                                   Stack trace of thread 11058:
                                                   #0  0x00007fa48a684f11 __strlen_avx2 (libc.so.6)
                                                   #1  0x00007fa48ad93a98 tparm (libtinfo.so.6)
                                                   #2  0x000055ac107b77d7 n/a (tmux)
                                                   #3  0x000055ac107b89e1 n/a (tmux)
                                                   #4  0x000055ac107b993b n/a (tmux)
                                                   #5  0x000055ac107ad20e n/a (tmux)
                                                   #6  0x000055ac107aec7e n/a (tmux)
                                                   #7  0x000055ac107a4a12 n/a (tmux)
                                                   #8  0x000055ac107af285 n/a (tmux)
                                                   #9  0x000055ac1077bb99 n/a (tmux)
                                                   #10 0x000055ac10778312 n/a (tmux)
                                                   #11 0x00007fa48a54ef4a __libc_start_main (libc.so.6)
                                                   #12 0x000055ac107784ea n/a (tmux)
Feb 21 12:00:01 XXX systemd[1]: Started Process Core Dump (PID 11258/UID 0).
Feb 21 12:00:01 XXX kernel: tmux: server[11058]: segfault at 2 ip 00007fa48a684f11 sp 00007ffeb3a16ba8 error 4 in libc-2.26.so[7fa48a52e000+1ae000]

I have played around with this a bit, why this is crashing:

  • Moving my .tmux.conf out of the way, starting with tmux' defaults, also crashes it.
  • I am using "st" as the main terminal. If I start "xterm", then start a completely new tmux instance, it does not crash, only when the tmux instance was started on st first.
  • It seems to have started appearing with NVIM 0.2.2-2, 0.2.2-1 is fine. I noticed it first at my Linux machine at work with NVIM 0.2.2-2, at home, with NVIM 0.2.2-1 this didn't happen. After upgrading my home machine to NVIM 0.2.2-2 it immediately started crashing.
  • My work machine had this problem yesterday, so I rebooted it, as there was a kernel upgraded, too. I normally do not reboot machines in the hope that application problems go away.
  • I have vcsh/mr deployed at work and home for config management, configs are mostly the same, there are minor differences due to the environment mostly. The config in this case, tmux, i3 and nvim, is the same though.
  • I understand this might not be an issue with tmux directly, probably the way I am using tmux/nvim/st. I love tmux, it is great software, just works and is a great productivity boost on the commandline. But tmux is coredumping here, that's why I am submitting it here and I want to help to improve it further that this issue goes away.
  • I am on Arch Linux, up2date.

I am happy to provide further information if required. I am happy to install a debug build, provide the coredump or compile a specific debug version from scratch. Just let me know what to do. I have not provided any reports to NVIM about 0.2.2-2 or Arch Linux.

@nicm

This comment has been minimized.

Contributor

nicm commented Feb 21, 2018

Logs?

@module0x90

This comment has been minimized.

module0x90 commented Feb 21, 2018

@eworm-de

This comment has been minimized.

eworm-de commented Feb 21, 2018

Just for the record: neovim 0.2.2-2 is a rebuild for unibilium 2.0.0-1.

@nicm

This comment has been minimized.

Contributor

nicm commented Feb 21, 2018

... tmux logs

@nicm

This comment has been minimized.

Contributor

nicm commented Feb 21, 2018

also does it still happen with a build from git master? (it will also be a debug build by default so you will get a better backtrace)

@module0x90

This comment has been minimized.

module0x90 commented Feb 21, 2018

Sorry... here are the logs:
tmux-client-1294.log
tmux-server-1296.log

Just cloning... and compiling. Please bear with me.

@module0x90

This comment has been minimized.

module0x90 commented Feb 21, 2018

Cloned 5a44e18 and ... started locally.
Same problem unfortunately:


                                                   Stack trace of thread 15216:
                                                   #0  0x00007f89a5da1e36 __GI___strlen_sse2 (libc.so.6)
                                                   #1  0x00007f89a6571a98 tparm (libncursesw.so.6)
                                                   #2  0x000056351b0ca966 tty_term_string1 (tmux)
                                                   #3  0x000056351b0cbc20 tty_putcode1 (tmux)
                                                   #4  0x000056351b0ccb6a tty_putcode1 (tmux)
                                                   #5  0x000056351b0c04a0 server_client_reset_state (tmux)
                                                   #6  0x000056351b0c213c server_loop (tmux)
                                                   #7  0x000056351b0b7902 proc_loop (tmux)
                                                   #8  0x000056351b0c2628 server_start (tmux)
                                                   #9  0x000056351b08e5b7 client_connect (tmux)
                                                   #10 0x000056351b08aae8 main (tmux)
                                                   #11 0x00007f89a5d2cf4a __libc_start_main (libc.so.6)
                                                   #12 0x000056351b08ad3a _start (tmux)

Feb 21 13:51:47 blackhole systemd[1]: Started Process Core Dump (PID 15442/UID 0).
Feb 21 13:51:47 blackhole kernel: tmux: server[15216]: segfault at 2 ip 00007f89a5da1e36 sp 00007fff2b486da8 error 4 in libc-2.26.so[7f89a5d0c000+1ae000]
@nicm

This comment has been minimized.

Contributor

nicm commented Feb 21, 2018

OK thanks. Can you load the core into gdb please and then run "bt full".

@module0x90

This comment has been minimized.

module0x90 commented Feb 21, 2018

@nicm

This comment has been minimized.

Contributor

nicm commented Feb 21, 2018

Your "Ss" entry is wrong:

1519220758.596852 st-256color 200: Ss: (string) \\033]52;%p1%s;%p2%s\\007

"Ss" only takes one parameter, but this has two. This make ncurses crash (because tparm() is variadic and uses the capability string to work out how many parameters to look for).

I think this is a typo in the st-0.7 entry in the terminfo database - it should be "Ms" not "Ss". This needs to be reported to the ncurses-dev mailing list or @ThomasDickey. This is the fix in terminfo.src:

diff --git a/misc/terminfo.src b/misc/terminfo.src
index 84f48108..ac300a7d 100644
--- a/misc/terminfo.src
+++ b/misc/terminfo.src
@@ -6262,3 +6262,3 @@ st-0.7|simpleterm 0.7,
            %t;7%;%?%p4%t;5%;%?%p5%t;2%;%?%p7%t;8%;m,
-       Ss=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B, kDN5=\E[1;5B,
+       Ms=\E]52;%p1%s;%p2%s\007, kDN3=\E[1;3B, kDN5=\E[1;5B,
        kLFT3=\E[1;3D, kLFT5=\E[1;5D, kNXT3=\E[6;3~,

You can fix this for the short term by doing this in .tmux.conf:

set -as terminal-overrides ',st*:Ss@'
@module0x90

This comment has been minimized.

module0x90 commented Feb 21, 2018

Awesome, will do. Many thanks, Nicholas.

short term fix works, too.

@module0x90

This comment has been minimized.

module0x90 commented Feb 22, 2018

Sincere apologies. I realized that I was running an older version of st, which had this incorrect terminfo settings still in there. Compiled against st-master and it works all just fine, even without the short term fix.

@nicm

This comment has been minimized.

Contributor

nicm commented Feb 22, 2018

Any system that uses terminfo unaltered from ncurses will have this problem.

@KireinaHoro

This comment has been minimized.

KireinaHoro commented Mar 27, 2018

Since update of ncurses-6.1 on Gentoo with the patch proposed in this thread applied on ncurses, tmux is complaining that it can't find xterm-256color:

open terminal failed: missing or unsuitable terminal: xterm-256color

The terminfo file for xterm-256color is located at /Users/jsteward/Gentoo/usr/share/terminfo/78/xterm-256color. Wonder why tmux can't find it.

It used to work before with ncurses-6.0 on Gentoo (w/o the patch above).

@Leryan

This comment has been minimized.

Leryan commented Jun 17, 2018

The problem can be solved by building and installing st correctly:

make clean
make
sudo make install

If you don't want to sudo make install you can run tic -sx st.info that will write only in your $HOME.

That way, no need to configure ~/.tmux.conf and no need to patch ncurses.

By the way, the Ss capability is only to change the cursor style so it's no big deal.

@mvrozanti

This comment has been minimized.

mvrozanti commented Nov 12, 2018

I couldn't get neovim to open inside tmux with zsh. Stumbled upon #1293 and can confirm the fix mentioned here but I still don't get why this worked though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment