Obtaining Diagnostic Output

Index of All Documentation » Wing Pro Reference Manual » Trouble-shooting Guide »


Wing and your debug code run in separate processes, each of which can independently be configured to collect additional diagnostic log information.

Diagnosing General IDE Problems

A quick way to diagnose problems seen while working with Wing is to submit a bug report from the Help menu. Please include a description of the problem and check the Include error log checkbox so we can diagnose and fix the problem.

To diagnose other problems, such as failure to start, try looking at the file ide.log in your User Settings Directory.

Alternatively, run console_wing.exe (on Windows) or wing6.0 --verbose (on Linux/Unix and OS X) from the command line to display diagnostic output.

Email this output to support at wingware.com along with your system type and version, version of Wing, version of Python, and any other potentially relevant details.

Diagnosing Debugger Problems

To diagnose debugger problems, set preference Debug Internals Log File to a value other than No logging and turn on preferences Use External Console and External Console Waits on Exit. When you try again, Wing will display a debug console with diagnostics.

Alternatively, copy wingdbstub.py out of your Wing installation, set WINGDB_LOGFILE environment variable to <stderr> or the name of a log file on disk (or alter kLogFile inside wingdbstub.py), turn on the Accept Debug Connections preference, and try launching the following script from the command line:

import wingdbstub
print("test1")
print("test2")

This prints diagnostic output that may be easier to capture in some cases.

Do not check the Extremely Verbose Internal Log preference unless Wingware Technical Support requests you to do so. When this is enabled, it will drastically slow down the debugger.

Email this output to support at wingware.com. Please include also the contents of the file ide.log in your User Settings Directory , and also your system version, version of Wing, version of Python, and any other potentially relevant details.

You will want to turn off diagnostic logging again after submitting your report because it can considerably slow down debugging.

Diagnosing Debug Process Crashing

If your debug process is crashing entirely while Wing is interacting with it, it may be that Wing is exercising buggy code when it inspects data in the debug process. In this case, it can be useful to capture the Python stack at the moment of the crash. You can do this by installing faulthandler into the Python that runs your debug process, and then adding the following to code that is executed before the crash:

import faulthandler
faulthandler.enable()

After that is done, the Python stack for each thread is written to <stderr> if the process crashes.

If you can't access <stderr>, you can send the stack to a file instead, as follows:

import faulthandler
segfault_fn = '/path/to/segfault.log'  # Change this to a valid path
f = open(segfault_fn, 'a')
faulthandler.enable(f)
# IMPORTANT: Leave f open!!!

It is very important that you leave the file f open for the life of the process. Otherwise faulthandler will corrupt another file by writing the stack there instead. This is a design limitation imposed by the nature of post-segfault processing.

Please send details of such crashes, including the Python stacks obtained by this method, to support@wingware.com. We will try to change Wing's data inspection to avoid the crash that you are seeing, and may be able to offer a work-around.