[wingide-users] Debugger won't pause

Michael Hipp michael at redmule.com
Sat Dec 10 12:29:44 MST 2011

On 2011-12-10 10:18 AM, Tom Stambaugh wrote:
> It's worth looking at cpu activity to see if it's busy (high CPU activity) or
> hung (waiting for something). Spin up a task-manager take a look. Also look to
> see how many "Python" tasks are running. If you've been doing stuff in the
> Python shell, the debugger occasionally gets confused (I kill my app, kill any
> Python tasks in task manager, then restart my app using the "Debug" button).

I checked most of that. The python tasks were using no CPU and memory usage was 
not changing. I have the Postgres server set to log 'all' and it was doing nothing.

> In the context you describe, I often see this behavior when the app is waiting
> in a timeout. Maybe a deadlock (your code is waiting for the DB, the DB is
> waiting for your code)? Maybe an exception was raised, silently got caught
> someplace, and now everything is waiting for something else to happen? How long
> did you wait after hitting the "Pause" button in the IDE (if it's a timeout,
> the IDE won't see your pause click until the timeout expires. Thirty seconds
> (never mind 2 minutes) feels like an eternity when you're sitting there waiting.

At one point I went and took a shower and did the rest of my morning routine to 
try and wait it out. Afterwards it was still just sitting there apparently 
doing nothing. Weird. I assume it was something like that timeout that Wing 
couldn't break into.

> I would suggest you try setting a breakpoint as your code enters the commit,
> and try stepping through your code until you find precisely what call provokes
> the apparent hang. With any luck, you'll see what's happening in slow-motion.

I never nailed it down to one specific call. It seemed to happen at more than 
one place depending on what I had commented out for testing.

But I have in the meantime solved the problem... This is a database conversion 
routine and it first deletes all existing records. For some reason I had never 
put a commit after that massive delete. Even tho there were lots of commits as 
it starting adding back records, something was confusing it. I've seen this 
sort of thing before. Anyways, putting a commit after the delete fixed the 
problem and I've moved on.

But I'd still like to know what I could do differently in Wing so it could be 
more helpful.


> On 12/10/2011 9:32 AM, Michael Hipp wrote:
>> To this point I've not been a very sophisticated user of the Wing
>> debugger; now trying to change that...
>> I have a program that is converting lots of records from a legacy
>> database and stuffing them into Postgresql via SQLAlchemy. Somewhere it
>> just stalls forever ... I'm pretty sure its deep in SQLA during a
>> commit(). If I hit the Wing 'Pause' toolbar button nothing seems to
>> happen. The Call Stack tool is empty and the program appears to still be
>> running but still not doing anything. The 'Step' tools remain disabled
>> on the toolbar. The stop button works fine but doesn't tell me where it
>> was stuck.
>> Is there something I can do in Wing to tell me where its getting hung?
>> Win7, Wing Pro 4.1.2-1, Py2.7.2.
>> Thanks,
>> Michael
>> _________________________________________________
>> Wing IDE users list
>> http://wingware.com/lists/wingide

More information about the wingide-users mailing list