Xpra: Ticket #1241: xvfb sometimes not stopped automatically

With xpra 0.17.4 sometimes xvfb is not stopped when the client is stopped even when --exit-with-children is specified.

The client is started via:

xpra start ssh/rvm:192.168.2.126:22/100 --start-child=/RVM/bin/RWFileEd --exit-with-children

The server output of a successful run when xvfb is stopped as well as the output of a run when xvfb is not stopped is attached.

ps of the not stopped xvfb:

rvm       9559  0.4  4.0 242968 82084 ?        Ssl  17:48   0:01 Xvfb-for-Xpra-:100 +extension Composite -screen 0 5760x2560x24+32 -nolisten tcp -noreset -auth /home/rvm/.Xauthority :100

Client output:

2016-06-30 17:48:28,865 Warning: using fallback encryption library pycrypto
2016-06-30 17:48:28,865  python-cryptography is not available: No module named cryptography.hazmat.backends
2016-06-30 17:48:28,865 Xpra gtk2 client version 0.17.2-r12591
2016-06-30 17:48:28,865  running on Linux Ubuntu 14.04 trusty
2016-06-30 17:48:28,865 Warning: failed to import opencv:
2016-06-30 17:48:28,865  No module named cv2
2016-06-30 17:48:28,865  webcam forwarding is disabled
Warning: failed to import GStreamer:
 GStreamer 1.0: Namespace Gst not available
 GStreamer 0.10: No module named pygst
2016-06-30 17:48:28,910 Error: failed to query sound subsystem:
2016-06-30 17:48:28,910  query did not return any data
[swscaler @ 0x1f96580] Warning: data is not aligned! This can lead to a speedloss
2016-06-30 17:48:29,100 PyOpenGL warning: missing accelerate module
2016-06-30 17:48:29,100 PyOpenGL warning: missing array format handlers: numeric, vbo, vbooffset
2016-06-30 17:48:29,100 OpenGL Version: 3.0 Mesa 10.1.3
2016-06-30 17:48:29,101 OpenGL support is missing:
2016-06-30 17:48:29,101  PyOpenGL version 3.1 or later is required (found version 3.0.2)
2016-06-30 17:48:31,924  detected keyboard: rules=evdev, model=pc104, layout=us
2016-06-30 17:48:31,925  desktop size is 1920x1080 with 1 screen:
2016-06-30 17:48:31,925   :0.0 (508x285 mm - DPI: 96x96) workarea: 1920x1045
2016-06-30 17:48:31,925     DVI-0 (510x287 mm - DPI: 95x95)
/RVM/sbin/SshdLog.sh: line 15: xpra: command not found
Entering daemon mode; any further errors will be reported to:
  /home/rvm/.xpra/:100.log
2016-06-30 17:48:36,971 Xpra X11 server version 0.17.4-r12942
2016-06-30 17:48:36,971  running on Linux Ubuntu 14.04 trusty
2016-06-30 17:48:36,971 enabled remote logging
2016-06-30 17:48:41,199 server requested disconnect: server shutdown

I tried the same as well with client 0.17.4. The behavior is identical.

Distribution: Ubuntu 14.04.4 LTS
Kernel: Linux RVM 4.4.8 #2 SMP Wed Jun 8 17:59:51 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux



Thu, 30 Jun 2016 22:04:31 GMT - floemker: attachment set


Thu, 30 Jun 2016 22:04:47 GMT - floemker: attachment set


Tue, 12 Jul 2016 16:52:22 GMT - Antoine Martin: milestone changed

Milestone renamed


Thu, 14 Jul 2016 20:52:15 GMT - floemker:

Further debugging showed that the cause is a SegV in libdbus:

  xpra[26878]: segfault at 4 ip 00007f192c32bd80 sp 00007ffe9df34158 error 6 in libdbus-1.so.3.7.6[7f192c308000+44000]

A backtrace for this SegV is attached.

I assume the reason is a missing call to dbus.mainloop.glib.threads_init(). It seems that after applying the attached patch there are no SegV's anymore and xvfb is stopped always correctly.


Thu, 14 Jul 2016 20:53:38 GMT - floemker: attachment set

Backtrace for a SegV in libdbus-1.so.3.7.6


Thu, 14 Jul 2016 20:54:10 GMT - floemker: attachment set

Fix for missing call to dbus.mainloop.glib.threads_init().


Thu, 14 Jul 2016 22:00:38 GMT - Antoine Martin: owner, description changed

Many thanks, applied to trunk in r13013 and v0.17.x in r13014.

I'm not entirely sure what triggers this, I thought we only made calls to dbus from the main thread but clearly that's not the case, maybe we have some racy cleanup calls. Ideally. I would like to figure out why.. not sure I'll have enough time. In any case, I don't see any harm in enabling threading in python dbus.

Can I close this ticket?


Fri, 15 Jul 2016 13:42:41 GMT - floemker:

Yes, here thread 4 and thread 1 called

Connection_send_message_with_reply_and_block()

at the same time. Closing the ticket is fine, I think. At least initial tests worked.


Fri, 15 Jul 2016 13:43:39 GMT - Antoine Martin:

I should have verified those changes before applying them... breakage ensued.

Fixups: r13018 + r13019.


Wed, 10 Aug 2016 04:23:38 GMT - Antoine Martin: status changed; resolution set


Sat, 23 Jan 2021 05:18:52 GMT - migration script:

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