Latest version of remmina segfaults when closing remmina's main windows while having an open connection #744

Closed
weberhofer opened this Issue Jan 26, 2016 · 17 comments

Projects

None yet

3 participants

@weberhofer
Collaborator

Jan 26 10:34:33 c-web1 kernel: remmina[11681]: segfault at 38 ip 00000000004203ef sp 00007ffe21137280 error 4 in remmina[400000+50000]

@giox069
Contributor
giox069 commented Jan 26, 2016

Unfortunately I'm unable to reproduce it under ubuntu. Can you post a backtrace ?
Start remmina from the commandline with gdb remmina, when it crashes, type bt and paste here the output.
Thank you for helping.

@weberhofer
Collaborator

How do I generate debug-code? My binaries are all stripped.

@giox069
Contributor
giox069 commented Jan 26, 2016

In cmake, add -DCMAKE_BUILD_TYPE=Debug. Works for both Remmina and FreeRDP.

@akallabeth
Contributor

maybe a race in the current cleanup code for rdp connections. struggled with simmilar issues for #733

@weberhofer
Collaborator

Starting gdb remmina results in something like

Reading symbols from remmina...Reading symbols from /usr/lib/debug/usr/bin/remmina.debug...done.
done.
(gdb) 

But I don't see a remmina window. Any hint?

@giox069
Contributor
giox069 commented Jan 27, 2016

type
run
to start remmina :)

@weberhofer
Collaborator

Ahhh... here it is:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004203ef in remmina_connection_holder_on_page_removed (notebook=<optimized out>, child=<optimized out>, 
    page_num=<optimized out>, cnnhld=0xbdea20) at /usr/src/debug/Remmina-1.1.99.git.20160126/remmina/src/remmina_connection_window.c:2505
2505        if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(cnnhld->cnnwin->priv->notebook)) <= 0)
(gdb) bt
#0  0x00000000004203ef in remmina_connection_holder_on_page_removed (notebook=<optimized out>, child=<optimized out>, page_num=<optimized out>, cnnhld=0xbdea20) at /usr/src/debug/Remmina-1.1.99.git.20160126/remmina/src/remmina_connection_window.c:2505
#1  0x00007ffff6982018 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#2  0x00007ffff699322d in  () at /usr/lib64/libgobject-2.0.so.0
#3  0x00007ffff699ada8 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#4  0x00007ffff699b062 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#5  0x00007ffff7738004 in  () at /usr/lib64/libgtk-3.so.0
#6  0x00007ffff69850e7 in g_cclosure_marshal_VOID__OBJECTv () at /usr/lib64/libgobject-2.0.so.0
#7  0x00007ffff6982247 in  () at /usr/lib64/libgobject-2.0.so.0
#8  0x00007ffff699a418 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#9  0x00007ffff699b062 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#10 0x00007ffff76574b5 in gtk_container_remove () at /usr/lib64/libgtk-3.so.0
#11 0x00007ffff7840ca5 in  () at /usr/lib64/libgtk-3.so.0
#12 0x00007ffff6988598 in g_object_run_dispose () at /usr/lib64/libgobject-2.0.so.0
#13 0x00007ffff772f296 in  () at /usr/lib64/libgtk-3.so.0
#14 0x00007ffff7658f30 in  () at /usr/lib64/libgtk-3.so.0
#15 0x00007ffff6981f92 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#16 0x00007ffff69935b4 in  () at /usr/lib64/libgobject-2.0.so.0
#17 0x00007ffff699ada8 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#18 0x00007ffff699b062 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#19 0x00007ffff7840d38 in  () at /usr/lib64/libgtk-3.so.0
#20 0x00007ffff6988598 in g_object_run_dispose () at /usr/lib64/libgobject-2.0.so.0
#21 0x00007ffff773c330 in  () at /usr/lib64/libgtk-3.so.0
#22 0x00007ffff7658f30 in  () at /usr/lib64/libgtk-3.so.0
#23 0x00007ffff6981f92 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#24 0x00007ffff69935b4 in  () at /usr/lib64/libgobject-2.0.so.0
#25 0x00007ffff699ada8 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#26 0x00007ffff699b062 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#27 0x00007ffff7840d38 in  () at /usr/lib64/libgtk-3.so.0

@giox069
Contributor
giox069 commented Jan 27, 2016

and then, you can type "quit" to exit, if I'm not wrong :)

Thank you for the report. The problem seems to be somewhere in remmina_connection_holder_on_page_removed(). I willl take a look later.

@giox069
Contributor
giox069 commented Jan 27, 2016

Just another question: which version of GTK+ are you using ?

@weberhofer
Collaborator

Installed are:
libgtk-2_0-0-2.24.29-5.2.x86_64
libgtk-3-0-3.16.7-5.1.x86_64

@giox069 giox069 added a commit that referenced this issue Jan 27, 2016
@giox069 giox069 Fixes for issue #744 14a7809
@giox069 giox069 added a commit that referenced this issue Jan 31, 2016
@giox069 giox069 Fixes for issue #744 b606256
@giox069 giox069 added a commit that referenced this issue Jan 31, 2016
@giox069 giox069 Fixes for issue #744 165b6ad
@giox069
Contributor
giox069 commented Jan 31, 2016

Fixes have been published on the next branch.

@weberhofer
Collaborator

Thank you for the fixes - unfortunately it still fails:

(gdb) bt
#0  0x00007ffff69a8b3b in  () at /usr/lib64/libgobject-2.0.so.0
#1  0x00007ffff699ab21 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#2  0x00007ffff699b592 in g_signal_emit_by_name () at /usr/lib64/libgobject-2.0.so.0
#3  0x0000000000423901 in cb_closewidget (widget=<optimized out>, data=<optimized out>) at /usr/src/debug/Remmina-1.1.99.git.20160201/remmina/src/remmina_exec.c:60
#4  0x0000000000442d51 in remmina_widget_pool_foreach (callback=callback@entry=0x4238e0 <cb_closewidget>, data=data@entry=0x0)
    at /usr/src/debug/Remmina-1.1.99.git.20160201/remmina/src/remmina_widget_pool.c:144
#5  0x0000000000423922 in remmina_exec_exitremmina () at /usr/src/debug/Remmina-1.1.99.git.20160201/remmina/src/remmina_exec.c:70
#6  0x000000000042fb79 in remmina_main_dexit (data=<optimized out>) at /usr/src/debug/Remmina-1.1.99.git.20160201/remmina/src/remmina_main.c:132
#7  0x00007ffff6f8cb65 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#8  0x00007ffff6f8ced8 in  () at /usr/lib64/libglib-2.0.so.0
#9  0x00007ffff6f8d19a in g_main_loop_run () at /usr/lib64/libglib-2.0.so.0
#10 0x00007ffff7704f05 in gtk_main () at /usr/lib64/libgtk-3.so.0
#11 0x00000000004198c4 in main (argc=1, argv=0x7fffffffdd88) at /usr/src/debug/Remmina-1.1.99.git.20160201/remmina/src/remmina.c:303


@giox069 giox069 added a commit that referenced this issue Feb 1, 2016
@giox069 giox069 Fixes for issue #744 1d73706
@giox069
Contributor
giox069 commented Feb 1, 2016

I pushed another commit/fix. Thank you for your patience :) When you want, you can try to test.

@weberhofer
Collaborator

The issue is fixed now. I have recognized one difference compared to the time before I had the issue above: When I closed the main windows I kept having the symbol in the task-bar (or however it is called). Now closing remmina's main window immediately closes/clean up all the windows. Before I had also a taskbar-symbol, now there is a transparent image placed there.

@giox069
Contributor
giox069 commented Feb 4, 2016

For the "transparent icon" in the systray, you are probably launching remmina from commandline and you have a subdir called "remmina" inside the current dir. And you compiled remmina with libappindicators. The bug is reported here:
https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1363277

For the exact remmina closing procedure: yes, I changed it a lot with this commit:
05cef51
One day I will draw a full map of "how closing remmina works", but in short is

  • In all desktops, choosing "exit" from the systray icon or from the main window File menu, will now close immediately remmina. If you just close the main window AND you have not disabled the systray icon, remmina will continue to run with only the systray icon visible.
  • The exception is gnome shell, and without gnome shell's appindicator extension activated: in this case the systray icon is not visible, so closing the main remmina window will also fully close remmina.
@weberhofer
Collaborator

After analyzing the changes, I have found out what really have changed for me: I have the option "Minimize window to tray" enabled; before the latest changes, closing the main windows it actually minimized it to the tray. Now, this setting is not taken into consideration in the "close" logic. The logic only checks if there is appindicator available.

For the UI-experience it would be better not to close the client windowtogether with then main window when the main window is closed. Remmina should IMHO close when the last window has been closed - this it more what a user expects who works with multi-window applications. I'm also not sure, if the option to start Remmina upon a user log-in is still working (without having appindicator).

@giox069
Contributor
giox069 commented Mar 6, 2016

Yes.
The basic idea when closing remmina main window initially was "do I have something on the screen that will enable me to close remmina later" ? If no, then exit remmina. "something on the screen" refers to GtkStatusIcon/appindicator, but unfortunately I forgot to check for an open connection window.
So, keeping remmina active until all client connection windows are closed can be done.
Could you close this issue and reopen a new one to keep track of the request ?
Thank you.

@weberhofer weberhofer closed this Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment