Run the application in a debugger.
Once it "hangs" press pause in the debugger, and continue to step through, and see what the code is doing which it is not supposed to do.