Debugger unable to Dump exceptions

Does anyone else have problems with the LINQPad 5 debugger failing to Dump exceptions?
Debugger error: Cannot abort FuncEval: Dump
Contrived example for a 404 error, C# expressions mode, break when exceptions are unhandled:
new WebClient().DownloadString("http://www.linqpad.net/GetFile.aspx?LINQPad6Setup.exe")
---------------------------
LINQPad Debugger Dump
---------------------------
Dumping this object requires all threads to run.

Unfreeze all threads?
---------------------------
Yes No
---------------------------
image

Comments

  • edited March 31
    I'm on Windows 7 x64 and LINQPad 5.21 AnyCPU in case that makes a difference.
    EDIT: also just verified on v5.22.02 as well

    Dumping some exceptions works fine like 1/int.Parse("0"), maybe it is WebException specific?
  • edited March 31
    That error appears when the operation initiated via the debugger (in this case, Dump) takes too long to execute and the debugger is unable to abort the operation. During the wait, LINQPad's debugger remains responsive due to it being asynchronous, but it still has to report the error, because the failed abort prevents the query process from continuing normally and requires a process recycle.

    (In case you're interested in the mechanics: The operation is executed via a "func-eval". Func-evals are essential in writing a debugger, but they also create a minefield. Here's some background: https://blogs.msdn.microsoft.com/jmstall/2006/03/05/what-does-a-debugger-author-need-to-do-to-support-func-eval/ and https://blogs.msdn.microsoft.com/jmstall/2005/03/23/func-eval-is-evil/ ).

    After trying your sample, I can successfully dump the WebException, which means I can't identity the cause without extra info. Can you try a couple of things:

    1. Run the same thing in VS. Does the debugger freeze for a while, or give an error?

    2. Click the minus sign on above the Dump. If you change the dump depth from 3 to 1, does it work? And if so, the output should contain hyperlinks that you can click. Does clicking any particular hyperlink cause an error? Sometimes particular property accessors are problematic and I can tell LINQPad to avoid calling them.
  • Thanks for the explanation of why it occurs :)

    1. VS 2013 doesn't freeze with the same code, but it seems to also only have a depth of 2 in the Exception's "View Detail" form, and won't let me drill down further.

    2. I am getting some very sporadic results, which I don't really understand. I think, if I get an exception from the func-eval and restart the query, I quite often end up with more problems, so I've taken to restarting LINQPad each time to be sure.

    It does indeed work when changing the dump depth to 1.

    Depth 2 also seems to work like depth 1, so it's something at depth 3 that causes it.

    But, at any depth, if I try to dump the exception again (i.e. a second time), quite often it fails. LINQPad handles it gracefully, though - after a long delay, I see a "Debugger dump timed out." message box, after which I can dump it again multiple times successfully.

    Most hyperlinks work fine, but at quite often items under the TargetSite (especially "DeclaringType", even though "ReflectedType", which has exactly the same value from what I can see, will work fine) causes a "Debugger error: Cannot abort FuncEval: RunUserAction" and/or the text where I clicked the hyperlink is stuck at "Executing..." until I complete the query by pressing Execute again, whereby the output appears to contain the expanded dump.

    Would that indicate that my .NET installation is at fault, taking too long to lookup types sometimes?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!