Tilix: Terminix crash on ssh timeout

Created on 2 Feb 2017  路  32Comments  路  Source: gnunn1/tilix

If I connect to an ssh server and leave the app for a long time (like 30minutes) the SSH server will not respond (and this is not a Terminix thing obviously, it's the ssh timeout) but when I try to hit "close" on Terminix window it crashes.

This is the app crash log: https://gist.githubusercontent.com/friimaind/8bad9785b24f8eeeffd022c0214a732c/raw/84282d59124368108b75aae19479d1f2a483b85a/terminix.crash.log

My System:

  • Ubuntu 16.10 Unity

My Terminix:

  • Versions

    • Terminix version: 1.4.2
    • VTE version: 0.44
    • GTK Version: 3.20.9
  • Terminix Special Features

    • Notifications enabled=0
    • Triggers enabled=0
    • Badges enabled=0
bug

All 32 comments

Thanks for the report. Is this reproduceable and if so if I built a debug version for you would you be willing to run it under gdb and get a backtrace? (I'll provide instructions, it's very easy to do).

Sure! Please let me know how can I do ;)

@gnunn1 I don't know if I made some mistakes but I tried gdb and this is the result:

gdb terminix
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from terminix...(no debugging symbols found)...done.
(gdb) run terminix
Starting program: /usr/bin/terminix terminix
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9935700 (LWP 5292)]
[New Thread 0x7fffe9134700 (LWP 5293)]
[New Thread 0x7fffe8933700 (LWP 5294)]
[New Thread 0x7fffda1fb700 (LWP 5295)]
[New Thread 0x7fffd99fa700 (LWP 5296)]
[Thread 0x7fffda1fb700 (LWP 5295) exited]
[Thread 0x7fffd99fa700 (LWP 5296) exited]

Thread 1 "terminix" received signal SIGSEGV, Segmentation fault.
0x00005555556e1b18 in ?? ()
(gdb)

Thanks, unfortunately the terminix binary needs to be built with debugging information in order for gdb to provide a proper backtrace. I should probably make a happy of building it both ways when I do a release.

I'll do the build for you later tonite when I'm back from work.

@friimaind How do you actually trigger ssh timeout? I wasn't able to reproduce the issue having connected to a ssh server and waited > 30 mins. What is the scenario?

I've uploaded a 1.4.2 version of the binary compiled with debug information at the link below. Run it in gdb and when it crashes, use the bt command in gdb to get the backtrace. Post everything here and I'll have a look. Thanks for your help tracking this down.

http://www.gexperts.com/files/terminix.zip

@f2404 honestly I don't really know. I have a cloud linux machine which on ssh, after about 30minutes without commands, it goes on some sort of timeout. I cannot insert new command so I need to close the window. If I use the stock ubuntu terminal I can close it, with Terminix I have a crash.

@gnunn1 I'm running your debug version of terminix. I I'll fill you in later. Thank you!

Here it is the backtrace https://gist.github.com/friimaind/b6a843a20b5a276cf27674352265bcd7
:)

Thanks! I think the issue is that you are using GtkD 3.5.0 which terminix depends on, there was a bug with it that caused a crash when showing any dialog. For example, invoke the advanced paste or password dialogs and it would crash. This is fixed in 3.5.1 and later.

Can you check what version of the GtkD package you have installed.

@gnunn1 Hope this helps:

dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
ii libgtk-3-0:amd64 3.20.9-1ubuntu2 amd64 GTK+ graphical user interface library
ii libgtk-3-bin 3.20.9-1ubuntu2 amd64 programs for the GTK+ graphical user interface library
ii libgtk-3-common 3.20.9-1ubuntu2 all common files for the GTK+ graphical user interface library
ii libgtk2-appindicator-perl 0.15-1build3 amd64 Perl bindings for libappindicator
ii libgtk2-imageview-perl 0.05-2build2 amd64 Perl bindings for the GtkImageView image viewer widget
ii libgtk2-perl 2:1.2498-3 amd64 Perl interface to the 2.x series of the Gimp Toolkit library
ii libgtk2-unique-perl 0.05-2ubuntu1 amd64 module for single instance applications
ii libgtk2.0-0:amd64 2.24.30-4ubuntu3 amd64 GTK+ graphical user interface library
ii libgtk2.0-bin 2.24.30-4ubuntu3 amd64 programs for the GTK+ graphical user interface library
ii libgtk2.0-common 2.24.30-4ubuntu3 all common files for the GTK+ graphical user interface library`

dpkg -s libgtkd-3-0
Package: libgtkd-3-0
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 13852
Maintainer: Debian GNOME Maintainers pkg-gnome-maintainers@lists.alioth.debian.org
Architecture: amd64
Source: gtk-d
Version: 3.3.1-2~webupd8~yakkety0
Depends: libgtk-3-0, libc6 (>= 2.14), libphobos2-ldc71
Description: GTK+ graphical user interface library - D bindings
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects ranging
from small one-off tools to complete application suites.
.
This package contains runtime files needed for applications written in D.
Homepage: http://gtkd.org/

How are you installing Terminix, from a package and if so which one?

Also if you activate the password dialog does it crash?

@friimaind Any update on the questions above? Your version of GtkD looks OK but the error still seems identical to the GtkD 3.5.0 issue.

sorry for the late @gnunn1

How are you installing Terminix, from a package and if so which one?

I installed Terminix from https://launchpad.net/~webupd8team/+archive/ubuntu/terminix

Also if you activate the password dialog does it crash?

Sorry, what password dialog?

I connect to the ssh server simply with "ssh root@HOST_IP". I insert the password and I'm in.

UPDATE I noticed that there is no relation with the timeout. I'm sorry. If I close the Terminix windows immediately after I connect to ssh it crashes.

selezione_002

This is the last gdb stacktrace: https://gist.github.com/friimaind/0b0fa70170255e0467c0b52491705eed

Hmm, this might be an easy solution based on that stack trace. Do you have the icon utilities-terminal installed in your system as part of your current icon theme? You can look for it with the following command:

find /usr/share/icons/ -name "utilities-terminal*"

Confirm that it is available in the icon theme you are using as it may be in others you have installed but not the in the theme you are using.

I'm using the icon theme "Numix-circle" and this is the result of

find /usr/share/icons/ -name "utilities-terminal*"

/usr/share/icons/Adwaita/scalable/apps/utilities-terminal-symbolic.svg
/usr/share/icons/Numix-Circle/48/apps/utilities-terminal.svg
/usr/share/icons/Humanity/apps/24/utilities-terminal.svg
/usr/share/icons/Humanity/apps/48/utilities-terminal.svg
/usr/share/icons/Humanity/apps/16/utilities-terminal.svg
/usr/share/icons/Humanity/apps/32/utilities-terminal.svg
/usr/share/icons/Humanity/apps/22/utilities-terminal.svg
/usr/share/icons/Humanity/apps/128/utilities-terminal.svg
/usr/share/icons/Humanity/apps/64/utilities-terminal.svg
/usr/share/icons/HighContrast/48x48/apps/utilities-terminal.png
/usr/share/icons/HighContrast/22x22/apps/utilities-terminal.png
/usr/share/icons/HighContrast/32x32/apps/utilities-terminal.png
/usr/share/icons/HighContrast/256x256/apps/utilities-terminal.png
/usr/share/icons/HighContrast/16x16/apps/utilities-terminal.png
/usr/share/icons/HighContrast/24x24/apps/utilities-terminal.png
/usr/share/icons/HighContrast/scalable/apps/utilities-terminal.svg

This is the way Terminix looks:

schermata del 2017-02-08 17-04-46

The line in the stack trace where it is failing is at the point it's trying to load the icon. Does it make any difference if you use a different icon theme?

I restored the default "ubuntu-mono-dark" icon theme without luck :(

https://gist.github.com/friimaind/080007272236b7496dcf52bfd482dbaa

Could you tell me the path where the icon is loaded?

It's not a specific path, it's just loaded from the resource following whatever rules it uses to locate the icon from the theme. In your stack trace, it looks like it is failing at this line:

https://gist.github.com/friimaind/0b0fa70170255e0467c0b52491705eed#file-gistfile1-txt-L99

with the message File o directory non esistente which is I'm thinking the icon is not being found. Looking at the terminix code here for 1.4.2 you can see the icon it's trying to load:

https://github.com/gnunn1/terminix/blob/1.4.2/source/gx/terminix/closedialog.d#L62

Oh.. The weird thing is that if I close a local terminal I don't have any problem but if I connect to any ssh server and then close the window without disconnecting from ssh server it crashes.

I'm thinking the icon is not being found

@gnunn1 I believe it's worth anticipating a case when an icon wasn't loaded by adding a check against null or something.

@f2404 Absolutely, I'm just trying to determine if this is in fact the issue

@friimaind The dialog requires that icon is only presented if a process is running when you try to close the terminal that's why it only happens in this case.

@gnunn1 thank you, I tried to close the Terminix window with running htop, tail -f but the crash did not occurred. Is this normal?

Did the close dialog appear for htop, if so the issue isn't the icon.

@gnunn1 Nope, I don't see any close dialog with htop. The window closes simply.

That's weird, it should be consistent for any process. If you run sleep 100 from the command line and then close the terminal do you get the dialog?

@gnunn1 nope, no dialog

What shell are you using, the default Ubuntu one, dash?

Also can you try the beta version I just posted and see if you have any better luck.

@gnunn1 I'm using the default one which, I think, is bash:

less /etc/adduser.conf
DSHELL=/bin/bash

I see if I can test the beta, thank you

So I can reproduce this on Ubuntu 16.10 now that I've finally got it running in a VM, very strange that it doesn't load the icon even though it's present. My error handling I've checked in fixes the issue but I'd like to understand what the issue with the icon loading is so leaving this open for a bit.

@gnunn1 thank you very much

I'm chalking up the icon loading as an Ubuntu bug since gtk3-icon-browser shows the icon just fine and it's only a minor cosmetic issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

roadhoghook picture roadhoghook  路  4Comments

gnunn1 picture gnunn1  路  3Comments

sirex picture sirex  路  3Comments

zsrinivas picture zsrinivas  路  4Comments

tomtobac picture tomtobac  路  3Comments