xpra icon
Bug tracker and wiki

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


Changes between Version 45 and Version 46 of Debugging


Ignore:
Timestamp:
01/12/17 12:23:41 (4 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debugging

    v45 v46  
    1717[[BR]]
    1818
     19{{{#!div class="box"
    1920== First Things ==
    2021Always try to narrow it down as much as possible, by turning off as many features as possible (clipboard, etc) and trying various encodings. Try another operating system, try a different version, etc
     
    2223{{{xpra info}}} is always good to have.
    2324
    24 
    25 == Debug Builds ==
    26 For application crashes, please try to use a debug build if one is available. It may provide more useful diagnostic messages.
    27 You can generate debug builds by calling {{{setup.py}}} with the {{{--with-debug}}} flag (or by setting {{{DEBUG=1}}} in the MS Windows [/browser/xpra/trunk/src/win32/MAKE-INSTALLER.BAT BAT file])
     25[/wiki/Logging Debug Logging] is the most commonly used debugging technique, enable logging for the subsystem categories relevant to your problem.
    2826}}}
    2927
    3028
    3129{{{#!div class="box"
    32 == Via Logging ==
     30== Debug Builds ==
     31For application crashes, please try to use a debug build if one is available or install the corresponding debuginfo packages. It may provide more useful diagnostic messages.
    3332
    34 [/wiki/Logging Debug Logging] is the most commonly used debugging technique.
     33You can generate debug builds by calling {{{setup.py}}} with the {{{--with-debug}}} flag.
    3534}}}
     35
     36
     37{{{#!div class="box"
     38== GDB ==
     39When dealing with crashes ("core dumped"), the best way to debug is to fire gdb to get a backtrace.
     40
     41=== Attaching to an existing xpra process ===
     42Find the pid of the xpra process:
     43{{{
     44ps -ef | grep xpra
     45}}}
     46Then:
     47{{{
     48gdb python $PID_OF_XPRA_PROCESS_TO_DEBUG
     49# wait for it to load all the debug symbols
     50(gdb) continue
     51}}}
     52
     53=== Starting xpra in gdb ===
     54{{{
     55gdb python
     56run /usr/bin/xpra start ...
     57}}}
     58or just:
     59gdb --args /usr/bin/python /usr/bin/xpra start ...
     60
     61=== Getting the backtrace ===
     62Then once you get a crash, gdb should show you its prompt again and you can extract the python stacktrace with {{{py-bt}}} and the full stacktrace with {{{bt}}}. Having both is useful.
     63
     64Note: installing the required "debug" symbol packages for your distribution is out of scope, please refer to your vendor's package manager for details (ie: [http://wiki.debian.org/HowToGetABacktrace debian] and [http://yum.baseurl.org/wiki/YumUtils/DebugInfoInstall yum debuginfo-install]).
     65}}}
     66
     67
     68----
     69
     70More advanced techniques below:
    3671
    3772
     
    5590== Fault Injection ==
    5691
    57 As of version 0.16, you can also inject faults in various places to trigger hard to reproduce error conditions.
     92You can also inject faults in various places to trigger hard to reproduce error conditions.
    5893
    5994For more details see #910.
     
    98133xtrace xpra attach ..
    99134}}}
    100 }}}
    101 
    102 
    103 {{{#!div class="box"
    104 == GDB ==
    105 When dealing with crashes ("core dumped"), the best way to debug is to fire gdb.
    106 === Attaching to an existing xpra process ===
    107 Find the pid of the xpra process:
    108 {{{
    109 ps -ef | grep xpra
    110 }}}
    111 Then:
    112 {{{
    113 gdb python $PID_OF_XPRA_PROCESS_TO_DEBUG
    114 # wait for it to load all the debug symbols
    115 (gdb) continue
    116 }}}
    117 
    118 === Starting xpra in gdb ===
    119 {{{
    120 gdb python
    121 run /usr/bin/xpra start ...
    122 }}}
    123 
    124 === Getting the backtrace ===
    125 Then once you get a crash, gdb should show you its prompt again and you can extract the python stacktrace with {{{py-bt}}} and the full stacktrace with {{{bt}}}. Having both is useful.
    126 Note: installing the required "debug" symbol packages for your distribution is out of scope, please refer to your vendor's package manager for details (ie: [http://wiki.debian.org/HowToGetABacktrace debian] and [http://yum.baseurl.org/wiki/YumUtils/DebugInfoInstall yum debuginfo-install]).
    127135}}}
    128136