[wingide-users] Trouble attaching to already-running process

Wingware Support support at wingware.com
Wed Dec 12 09:45:36 EST 2012

Paul Du Bois wrote:
> I'm running the latest Wing Pro4.1  on win32 (4.1.9-1 (rev 27437)) and am trying to set up a workflow where I can attach to an already-running .pyw process.
> Passive connect works just fine -- ie, I can start the debugger, then the app, and the app successfully connects to the debugger.  I cannot use "Debug ->  Attach to Process...", though; not even if I launch from the IDE, detach, then try to reattach.
> The wingdbstub log file doesn't have much interesting in it.  It certainly seems to have bound the port:
> wingdbg -2012/12/11 21:23:28  - 'CHECK FOR CONNECTION'
> wingdbg -2012/12/11 21:23:28  - 'LISTENER INFO:' ('', 50015)
> wingdbg -2012/12/11 21:23:28  - 'SELECT RESULT' [] [] []
> I can connect to 50015 by hand from a python console, too; and netstat shows I'm connecting to the app that's imported wingdbstub.
> There are no weird permissions or user issues; the wingdbgpw file in my userprofile is readable.  Just in case, I've also copied it next to wingdbstub.py
> When I attach, nothing happens -- the info light on the bottom left stays white.  Trying to attach again brings up the dialog box:
> Could not attach to host, port 50015: The remote process is not accepting connections, or is not running.  This may be caused by a missing or incorrect wingdebugpw file.  The wingdebugpw file in the IDE's user settings directory (C:\Users\dubois\AppData\Roaming\Wing IDE 4) must match the wingdebugpw file that is being read by the debug process (see kPWFilePath in wingdbstub.py).
> My debugger messages are not so interesting:
> No debug process / not listening for connections
> No debug process / listening for connections on TCP/IP port 50005
> Allowed hosts:
> Any thoughts on how to troubleshoot this further?  The verbose log is extremely verbose, but I haven't found anything interesting in it.

If the debug process is not running any Python code for a while then 
Wing may fail to attach (servicing the TCP/IP socket is done from code 
invoked from the tracer).  However, that may not be the issue since you 
could attach by hand to that port.

After trying this again and having it fail, can you send the entire 
IDE-side log, which is most easily done by submitting a bug report from 
the Help menu and including the error log when prompted?  Getting the 
whole wingdbstub log for for that run would be useful also.

Also, are the IDE and debug process running no the same machine as the 
same user?  The wingdebugpw file is of course only checked after 
connecting so it may be that it is managing to connect but then being 
rejected (or something else is going wrong after the connection is made).



Stephan Deibel
Wingware | Python IDE
Advancing Software Development


More information about the wingide-users mailing list