xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 10 years ago

Closed 10 years ago

Last modified 16 months ago

#126 closed defect (fixed)

Certain keypresses in SAS which ring the bell cause xpra client to crash

Reported by: alis Owned by: Antoine Martin
Priority: major Milestone: 0.3
Component: client Version: 0.2.0
Keywords: Cc:


While running the Linux SAS 9.2 GUI application in xpra (Linux xpra server and Linux xpra client), most things work fine. However, certain keypresses which the application considers "invalid," such as pressing the up arrow when already at the top of a text area, cause the xpra client to crash and disconnect. The application continues running in the server and can be re-attached to without any problems, until another "invalid" keystroke crashes the xpra client again.

The problem appears to occur when the application attempts to ring the bell in response to the invalid keypress. The error given is:
'XI_BadDevice (invalid Device parameter)'.
(Details: serial 214105 error_code 160 request_code 147 minor_code 3)

When run with --debug=all, the relevant portions seem to be (full log attached):

~> xpra --debug=all attach ssh:pt-sas06:100
set default window icon to /usr/bin/../share/xpra/icons/xpra.png
bell_toggled((<gtk.CheckMenuItem object at 0xd6ebe0 (GtkCheckMenuItem at 0xa750d0)>,)) bell_enabled=True
cursors_toggled((<gtk.CheckMenuItem object at 0xd6ec80 (GtkCheckMenuItem at 0xa75190)>,)) cursors_enabled=True


handle_key_action(<gtk.gdk.Event at 0x10119e0: GDK_KEY_PRESS keyval=Up>,<ClientWindow object at 0x10d81e0 (xpra+client+ClientWindow at 0xf8a610)>,True)
key_action(<gtk.gdk.Event at 0x10119e0: GDK_KEY_PRESS keyval=Up>,<ClientWindow object at 0x10d81e0 (xpra+client+ClientWindow at 0xf8a610)>,True) modifiers=['mod2'], name=Up, state=<flags GDK_MOD2_MASK of type GdkModifierType>, keyval=65362, string=, keycode=111
scheduling key repeat for Up: delay=400, interval=5 (from 500 and 28)
key repeat: starting timer for Up / 111 with delay 400 and interval 5
read thread: got data 'Bm\x14\x1b\x9b\x01\xd3zRjNN&h\xf7\x120\xa5\x83k\\\x10\x1bD\x80\x91\x81U*\x00\x00\x00\xff\xff'
_process_bell(['bell', 0, 1, 50, 400, 100, 0, 0, '']) gdkwindow=<gtk.gdk.Window object at 0x10c7c30 (GdkWindow at 0xa78120)>
The program 'xpra' received an X Window System error.
This probably reflects a bug in the program.
The error was 'XI_BadDevice (invalid Device parameter)'.
  (Details: serial 1388 error_code 160 request_code 147 minor_code 3)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Attachments (1)

xpra-crash.log (34.8 KB) - added by alis 10 years ago.
stdout/stderr log of xpra client

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by alis

Attachment: xpra-crash.log added

stdout/stderr log of xpra client

comment:1 Changed 10 years ago by Antoine Martin

Status: newaccepted

I believe this is fixed in trunk, see #93 and r772

comment:2 Changed 10 years ago by Antoine Martin

Does v0.3.0 fix this for you?

In any case, would you mind trying this patch:

Index: src/xpra/client.py
--- src/xpra/client.py	(revision 865)
+++ src/xpra/client.py	(working copy)
@@ -1077,6 +1077,7 @@
         if gdkwindow is None:
             gdkwindow = gdk.get_default_root_window()
         log("_process_bell(%s) gdkwindow=%s", packet, gdkwindow)
+        device = 0
         self._client_extras.system_bell(gdkwindow, device, percent, pitch, duration, bell_class, bell_id, bell_name)
     def _process_notify_show(self, packet):

I believe the device number is not portable from client to server so we should always use XkbUseCoreKbd (zero) here.

This is probably a better fix as it will ensure the bell does ring, rather than silently ignoring the X11 error that was causing the crash previously.

comment:3 Changed 10 years ago by alis

The change in r772 does fix the problem of the crashes.

The device=0 patch above, however, does not seem to work. I still get the "error using device_bell: 160, will fallback to gdk beep" message when I have the r772 patch installed, and a crash without r772 in. It looks like device=0 already in all of my tests.

comment:4 Changed 10 years ago by Antoine Martin

Resolution: fixed
Status: acceptedclosed

oh well, I give up, I don't understand this bell_class/bell_id/device business (the docs are not particularly helpful)

comment:5 Changed 9 years ago by Antoine Martin

r2229 forces:

  • device=XkbUseCoreKbd
  • class_id=XkbDfltXIId

as we should not be using the device-ids from the server.

comment:6 Changed 16 months ago by migration script

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

Note: See TracTickets for help on using tickets.