xpra icon
Bug tracker and wiki

Opened 3 years ago

Closed 3 years ago

#1241 closed defect (fixed)

xvfb sometimes not stopped automatically

Reported by: floemker Owned by: floemker
Priority: major Milestone: 1.0
Component: server Version: 0.17.x
Keywords: Cc:

Description (last modified by Antoine Martin)

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

Attachments (4)

ServerError-100.log (5.7 KB) - added by floemker 3 years ago.
ServerOk-100.log (5.8 KB) - added by floemker 3 years ago.
SegV-BackTrace.txt (40.2 KB) - added by floemker 3 years ago.
Backtrace for a SegV in libdbus-1.so.3.7.6
DBusThreadsInit.patch (347 bytes) - added by floemker 3 years ago.
Fix for missing call to dbus.mainloop.glib.threads_init().

Download all attachments as: .zip

Change History (10)

Changed 3 years ago by floemker

Attachment: ServerError-100.log added

Changed 3 years ago by floemker

Attachment: ServerOk-100.log added

comment:1 Changed 3 years ago by Antoine Martin

Milestone: 0.181.0

Milestone renamed

comment:2 Changed 3 years ago by 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.

Changed 3 years ago by floemker

Attachment: SegV-BackTrace.txt added

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

Changed 3 years ago by floemker

Attachment: DBusThreadsInit.patch added

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

comment:3 Changed 3 years ago by Antoine Martin

Description: modified (diff)
Owner: changed from Antoine Martin to floemker

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?

comment:4 Changed 3 years ago by 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.

comment:5 Changed 3 years ago by Antoine Martin

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

Fixups: r13018 + r13019.

comment:6 Changed 3 years ago by Antoine Martin

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.