bugs Debugging

In an ideal world, everything should always work reliably without any glitches.
But this is not an ideal world, so you may encounter problems (sorry!), this section should help you figure out what is going wrong or at least help you gather enough information so that someone can help you.


target Where is the problem?

The first thing to do is to identify the problem:

browse Getting More Information

The first thing to do is to run the software (this applies to both the server and the applet) in debug mode.
This can be done in the Configuration panel for the applet, in the configuration files, using a signal (see below), or by starting the software from the command line and adding --debug_mode, ie for the applet:
winswitch_applet --debug_mode

Threads and signals

In case you suspect a threading problem, you can send the SIGUSR1 signal to make the process dump all the threads currently active.
It will also turn on debugging, which can be turned off with SIGUSR2.

help Early Failures

To get more diagnostic messages (especially in the case of non-start or early failures), you may also launch the client from the command line:

winswitch_applet --log_to_tty --debug-imports
This will print all the early diagnostic messages to your terminal.

help X11 Errors

Because of the asynchronous nature of the X11 protocol, you will generally get a cryptic error message of the form:

The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 473436 error_code 3 request_code 42 minor_code 0)
(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.)

In order to debug these types of errors with GTK3 you will need to run the application in gdb (either launch it from there - or simply attach to the process pid) and ensure that the application is started with the following environment variable set:

GDK_SYNCHRONIZE="1"
You should then be able to get a backtrace using gdb. You may be able to break on _exit, exit or _XError
For more information, including many environment variables used for debugging GTK internals, see GTK running (gnome.org).