Xpra: Ticket #1981: xpra under unity with opengl=no is unresponsive

Hi, as discussed in http://lists.devloop.org.uk/pipermail/shifter-users/2018-October/002228.html,

We run xpra attach from unity in ubuntu 18.04. In 16.04 this worked, but after an upgrade to 18.04 windows are just not at all opening on the attached xpra client.

I attach the output of xpra info.



Sun, 07 Oct 2018 12:54:44 GMT - iwan: attachment set

xpra info output


Sun, 07 Oct 2018 12:56:27 GMT - iwan: attachment set

xpra opengl output


Sun, 07 Oct 2018 15:01:36 GMT - Antoine Martin: owner, summary changed

How do I configure my Ubuntu 18.04 VM to be in the same state as yours? What packages do I install? How do I select the Unity desktop? Can you post the output of "env" from the client?


Mon, 08 Oct 2018 05:31:04 GMT - iwan:

Replying to Antoine Martin:

How do I configure my Ubuntu 18.04 VM to be in the same state as yours? What packages do I install? How do I select the Unity desktop?

My system used to be on 16.04, then was upgraded to 18.04 so I am not sure the effects of that history can be exactly replicated.

But, on a new ubuntu install, instructions are to:

sudo apt-get install ubuntu-unity-desktop, when prompted choose lightdm desktop manager (not sure if that's true for me, or how to check...)

On the login screen, I see a little gear which I can click and select a Unity session before logging in.

Instructions here https://linuxconfig.org/how-to-install-unity-desktop-on-ubuntu-18-04-bionic-beaver-linux show the ubuntu circle logo being clicked on to choose something similar.

Can you post the output of "env" from the client?

I don't know what you mean here, I assume the config setting? If so then:

xpra showconfig env gives:

env = []


Mon, 08 Oct 2018 08:58:03 GMT - Antoine Martin: owner, status, milestone changed

I don't know what you mean here, I assume the config setting? If so then:

No, I meant running the env command and posting its output. But never mind, I can reproduce it. Ubuntu devs have messed up something in GTK, big time.

Whilst I was there, I thought I would try the python3 / gtk3 builds to see if they have sabotaged GTK3 too. It turns out that they have too! You can crash the whole process by trying to use their awful appindicator API! (see ticket:406#comment:2)


Mon, 08 Oct 2018 09:16:44 GMT - iwan:

No, I meant running the env command and posting its output.

A, sorry, got confused with the formatting in the email.

But never mind, I can reproduce it.

Great.

Thank you for digging into it.


Mon, 08 Oct 2018 09:54:36 GMT - Antoine Martin: owner, status changed

A gdb backtrace showed something very wrong:

/usr/local/lib/python2.7/dist-packages/xpra/client/gl/gtk_base/gtkgl_check.py:152: Warning: cannot register existing type 'GdkScreen'
  glarea.realize()
/usr/local/lib/python2.7/dist-packages/xpra/client/gl/gtk_base/gtkgl_check.py:152: Warning: g_once_init_leave: assertion 'result != 0' failed
  glarea.realize()
/usr/local/lib/python2.7/dist-packages/xpra/client/gl/gtk_base/gtkgl_check.py:152: GtkWarning: gdk_screen_is_composited: assertion 'GDK_IS_SCREEN (screen)' failed
  glarea.realize()
Thread 1 "python2" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in  ()
#1  0x00007ffff7d9ec2b in gdk_window_set_decorations () at /usr/lib/x86_64-linux-gnu/libgtk3-nocsd.so.0
#2  0x00007ffff412955b in  () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#3  0x00007fffefc5b44f in  () at /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libunity-gtk-module.so
#4  0x00007ffff47d0b6d in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff47e3a96 in  () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6  0x00007ffff47ec882 in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#7  0x00007ffff47ececf in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#8  0x00007ffff411d178 in gtk_widget_realize () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#9  0x00007ffff411d219 in gtk_widget_realize () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#10 0x00007ffff411d219 in gtk_widget_realize () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#11 0x00007ffff444569d in  () at /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
#12 0x000055555564211e in PyEval_EvalFrameEx ()
#13 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#14 0x000055555564201e in PyEval_EvalFrameEx ()
#15 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#16 0x000055555564201e in PyEval_EvalFrameEx ()
#17 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#18 0x00005555556424d9 in PyEval_EvalFrameEx ()
#19 0x0000555555641d25 in PyEval_EvalFrameEx ()
#20 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#21 0x00005555556424d9 in PyEval_EvalFrameEx ()
#22 0x0000555555641d25 in PyEval_EvalFrameEx ()
#23 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#24 0x00005555556424d9 in PyEval_EvalFrameEx ()
#25 0x0000555555641d25 in PyEval_EvalFrameEx ()
#26 0x000055555563a4d9 in PyEval_EvalCodeEx ()
#27 0x0000555555639e89 in PyEval_EvalCode ()
#28 0x000055555566e51f in  ()
#29 0x0000555555668d74 in PyRun_FileExFlags ()
#30 0x00005555556682d7 in PyRun_SimpleFileExFlags ()
#31 0x000055555560b28b in Py_Main ()
#32 0x00007ffff7bd609b in __libc_start_main (main=
    0x55555560ad10 <main>, argc=6, argv=0x7fffffffdd68, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdd58) at ../csu/libc-start.c:308
#33 0x000055555560ac4a in _start ()

libgtk3-nocsd was being loaded into a gtk2 process!

Removing gtk3-nocsd fixed my problems:

apt-get remove -y gtk3-nocsd libgtk3-nocsd0

@iwan: maybe your system has the same buggy library installed?

If not, please post the gdb backtrace (with and without opengl enabled):

gdb --args /usr/bin/python /usr/bin/xpra attach ..
run

Mon, 08 Oct 2018 12:48:52 GMT - iwan:

Indeed I had those libs as well, and removing them fixed the problem.

Thank you.

It seems that "unity-session Recommends gtk3-nocsd" which would pull libgtk3-nocsd0 in also. I will try log a bug for them.


Mon, 08 Oct 2018 13:04:15 GMT - Antoine Martin: status changed; resolution set

I'm closing this as invalid, the bug is in Ubuntu unity / packaging.


Tue, 09 Oct 2018 05:36:00 GMT - iwan:

BTW, I see that unity itself seems to be gtk3 (by looking at its dependencies), so the issue may be elsewhere. Perhaps the python gtk bindings?


Tue, 09 Oct 2018 08:35:29 GMT - Antoine Martin:

Something ends up loading GTK3 symbols into a GTK2 process. This is never going to end well. My guess is that the LD_PRELOAD trick used by nocsd is overriding GTK2-X11 symbols it shouldn't be messing with. (gnome / GTK keep making it harder for people to disable annoying functionality, like CSD... their refusal to accept the simple nocsd toggle in their codebase is an endless source of pain for others)


Sat, 23 Jan 2021 05:38:57 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1981