Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dsdp-dd-dev] session shutdown not working

Hi Jasper,
Thank you for trying out DSF, I hope I can help you debug your problem.
Jesper Eskilson wrote:
Hi all,

I'm trying to implement a DSF-based debugger, following the PDA example as closely as possible.

The problem is that the session shutdown does not work properly. All the steps in the shutdown sequence are executed, but the handleCompleted() method is never invoked for the sequence itself. The debugview still contains icons for the launch and the debugged program.
First of all debugging these kinds of bugs is very common when programming with DSF since there's no compiler support for ensuring that request monitors are completed in all paths. I find that the easiest way to debug these problems is actually through inspection: making sure that all code paths complete the outstanding request monitors. In your case I would first check that the last step in the shutdown sequence completes its request monitor. If that's the case already, I would put a breakpoint on where the last RM is completed and I would step from there to see if it triggers completing another RM. For example I would set a breakpoint on Sequence.java:275 and see if there are any exceptions thrown.

What is the canonical way of debugging these kinds of deadlocks?

(I switched on the DsfExecutable.DEBUG_EXECUTOR field, and got a lot of messages on the form "DsfExecutable was never executed" even for things which seem to work fine. Is that expected?)
It is a rule in DSF that all request monitors that are created are completed at some point by having done() called on them. So any request monitors that trigger this trace are theoretically request monitors which were leaked and never completed. Examining these, and tracing the logic that used them can help debug subtle and difficult bugs. Unfortunately even with the exemplary implementation there are instances where this rule is not followed, because it becomes very difficult to guarantee that all request monitors get completed when the system is shutting down and when the executor throws RejectedExecutionExceptions.

Cheers,
Pawel


Back to the top