<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx</link><description>We announced at PDC today that we're making some significant advances in diagnostics tool support for CLR v4! In particular, we've been investing heavily in improving our support for production diagnostics scenarios over the past couple years. I'm excited</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9029089</link><pubDate>Sun, 02 Nov 2008 14:13:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9029089</guid><dc:creator>Steven the .NET Junkie</dc:creator><description>&lt;p&gt;Am I missing something? The current version of the CLR is version 2.0 (for .NET 2.0, 3.0, 3.5 and 3.5 SP1). Are you skipping version number 3 for the CLR.&lt;/p&gt;
&lt;p&gt;Can you remember the old adventure game Leisure Suit Larry? They skipped version 4 because they lost the floppies. Did the CLR team loose the floppies for CLR 3 or is this yet another strange branding thing like happened with .NET 3.0 and up?&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9034393</link><pubDate>Mon, 03 Nov 2008 21:39:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9034393</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Great question Steven. &amp;nbsp;No we did not lose the code for CLR v3 &amp;lt;grin&amp;gt;, we just want to try to avoid confusion by keeping the CLR and .NET version numbers in sync as much as possible. &amp;nbsp;So yes we skipped CLR v3 so that .NET 4.0 would contain CLR v4.&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9045208</link><pubDate>Thu, 06 Nov 2008 00:24:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9045208</guid><dc:creator>Steven the .NET Junkie</dc:creator><description>&lt;p&gt;I'm glad you are trying to sync the numbers again, but I never understood why Microsoft got itself into this mess anyway. I must say I was quite frustrated about the whole branding scheme of .NET 3.0. The argument was that .NET 3.0 was a significant improvement over .NET 2.0 (Microsoft added WinFX), but I found this a pretty bad argument compared to the confusion it caused. By naming the next CLR ‘4.0’, you are actually agreeing with this statement.&lt;/p&gt;
&lt;p&gt;Please don’t listen to those marketing guys again, ever!&lt;/p&gt;</description></item><item><title>New stuff in Profiling API for upcoming CLR 4.0</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9058866</link><pubDate>Tue, 11 Nov 2008 02:05:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9058866</guid><dc:creator>David Broman's CLR Profiling API Blog</dc:creator><description>&lt;p&gt;Now that we've finally announced at PDC many of the new features coming up in the next major release&lt;/p&gt;
</description></item><item><title>Managed Dump Debugging</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9162892</link><pubDate>Tue, 02 Dec 2008 06:41:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9162892</guid><dc:creator>fatkenny</dc:creator><description>&lt;p&gt;Excellent posting, thank you for all the information.&lt;/p&gt;
&lt;p&gt;I was curious on the managed dump debugging. Is the plan to eventually support this on some form of mini dump (perhaps a new flag in MiniDumpWriteDump to collect the managed information?) Your post made it sound like the CTP requires HeapMemory in the minidumps (MiniDumpWithFullMemory?) It sounds like the plan for release is to support this with a much smaller minidump package though, is that correct? (Beers are on me if it does...)&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9163093</link><pubDate>Tue, 02 Dec 2008 07:59:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9163093</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Fatkenny - You cought me, I was intentionally being vague on the point of minidump support (we weren't done yet). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, the CTP requires MiniDumpWithFullMemory. &amp;nbsp;Minidump generation has actually worked since CLR 2.0, you just have to use SOS to consume them (and they're limited really to stack traces, dumping active exception objects, and listing threads) - see &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/magazine/cc163833.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163833.aspx&lt;/a&gt; for details. &lt;/p&gt;
&lt;p&gt;I'm happy to say that we just recently finished adding support for consuming managed minidumps through ICorDebug to the CLR v4 codebase. &amp;nbsp;So things that worked with SOS in CLR v2 on minidumps will now work through ICorDebug in CLR V4. &amp;nbsp;Minidump generation hasn't changed a whole lot, but being able to open them in VS with the UI you're used to (and so also access them programatically with ICorDebug) is a nice bonus.&lt;/p&gt;
&lt;p&gt;Glad you're interested in this. &amp;nbsp;I'd be curious to know how you plan to use it. &amp;nbsp;Eg., do you use Windows Error Reporting today?&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9165767</link><pubDate>Tue, 02 Dec 2008 22:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9165767</guid><dc:creator>fatkenny</dc:creator><description>&lt;p&gt;Right now we generate our own minidumps at various points in our system (for a variety of reasons. Sometimes this is for unexpected situations like exceptions crossing a boundary, sometimes in attempts to analyze why something did not respond in a reasonable time, etc.) &lt;/p&gt;
&lt;p&gt;Most of our installations sit on machines which can not access the internet (or even most of the respective corporate intranets.) We tend to have the ability to connect to machines at certain times for support though. At that point we &amp;quot;harvest&amp;quot; whatever minidumps we may have generated. Unfortunately our connection to the client machines run the gamut as far as bandwidth is concerned, so the small svelte nature of non-full memory minidumps is great for us. It is my very laynerd understanding of WER that makes me think it would not be useful in our current situation (we are in a very vertical market.)&lt;/p&gt;
&lt;p&gt;We have found the minidumps to be INCREDIBLY useful (so useful that I am compelled to use all caps :)) The addition of the ability to be able to see the managed stack in visual studio will be an aweseom thing for us. (Meaning without using SOS, which we have done some of in house, but we don't do it enough to make it as second nature as normal Visual Studio post mortem unmanaged dump debugging.)&lt;/p&gt;
&lt;p&gt;Just to clarify though, is the plan to support debugging managed dumps (getting stack traces, exception info, threads, etc) via the smaller size (re: non-full memory) mini dumps at release time? I realize that the need to ship can make this sort of feature not happen, but it sounded like that was y'alls plan (which again, would make me a happy nerd.)&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9166303</link><pubDate>Wed, 03 Dec 2008 00:37:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9166303</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Yes, the plan is to support basic debugging of minidumps (without MiniDumpWithFullMemory or even MiniDumpWithPrivateReadWriteMemory) in Visual Studio 2010. &amp;nbsp;Sounds like your scenario is a pefect consumer of this. &amp;nbsp;Be sure to try out Beta1 when it becomes available and let us know how it works for you!&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9211715</link><pubDate>Sun, 14 Dec 2008 00:35:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9211715</guid><dc:creator>kajo0011</dc:creator><description>&lt;p&gt;I am also very interested in the (Mini-)Dump support!&lt;/p&gt;
&lt;p&gt;We have almost the same scenario like fatkenny. We have shipped around 4000 apps (software for controlling industrical machines) which are only connected to our service team, if they hove problem. And in this case it is very important to clearly indentify the problem. And minidumps were the best we could think of. Currently I a missing source-support in sos.dll/WinDbg.&lt;/p&gt;
&lt;p&gt;But to my point:&lt;/p&gt;
&lt;p&gt;I tried it in the VS2010CTP-version and it &amp;quot;worked&amp;quot; with full memory, but it does not show the &amp;quot;correct&amp;quot; callstack! It showed the callstack which wrote the minidump ;) So you need to switch to the exception-callstack...&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9212266</link><pubDate>Sun, 14 Dec 2008 03:11:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9212266</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Thanks Kajo0011, I'm glad this will help your scenarios. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;By switch to the exception callstack, you mean the thread that threw the exception? &amp;nbsp;Yes, I believe that's a known bug, it should start on the crashing thread by default. &amp;nbsp;We'll try to get this fixed for beta1 (no promised though of course - there are always surprises &amp;lt;grin&amp;gt;).&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9219174</link><pubDate>Mon, 15 Dec 2008 11:39:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9219174</guid><dc:creator>kajo0011</dc:creator><description>&lt;p&gt;Thanks rmbyers!&lt;/p&gt;
&lt;p&gt;Just a small note: The _thread_ is the correct one.... but the callstack is the wrong one. The callstacks displays the state of writing the minidump; but it should display the state of the exception (in WinDbg this is the &amp;quot;.ecxr&amp;quot; command).&lt;/p&gt;
&lt;p&gt;For more details and a repro step see Connect:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=387985"&gt;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=387985&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you do not switch to the &amp;quot;exception callstack&amp;quot; then the minidump-support is almost useless...&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9221599</link><pubDate>Mon, 15 Dec 2008 20:42:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9221599</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Ah, I see what you're saying now. &amp;nbsp;The main problem is that you're generating your dump on the second-pass of exception-hanlding (in a catch block), which means the stack that threw the exception has already been unwound (see &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/cbrumme/archive/2003/10/01/51524.aspx"&gt;http://blogs.msdn.com/cbrumme/archive/2003/10/01/51524.aspx&lt;/a&gt;). &amp;nbsp;Even .ecxr wouldn't work here - the context is gone (stack has been at least partially overwritten).&lt;/p&gt;
&lt;p&gt;If you're generating a dump in response to an exceptiom, you REALLY want to generate the dump before the stack is unwound (since it's that stack that has most of the information on the cause of the exception). &amp;nbsp;This is actually a problem in native C++ too, but managed code does make it more painful.&lt;/p&gt;
&lt;p&gt;To generate a dump before the stack is unwound, you probably want to use an &amp;quot;exception filter&amp;quot;. &amp;nbsp;Unfortunately, C# has no syntax for this, so you have to use VB or IL to write it. &amp;nbsp;I've had this topic on my &amp;quot;to blog&amp;quot; list for awhle - I just bumped it to the top of the list - expect something soon...&lt;/p&gt;
&lt;p&gt;The built-in error-reporting support in the CLR does this - invoke error reporting (and hence dump generation) before the stack is unwound. &amp;nbsp;But there is still a fundamental problem with catching and rethrowing exceptions (eg. reflection catches all exceptions and wraps them in a TargetInvocationException).&lt;/p&gt;
&lt;p&gt;In addition to this main major issue, there may also be some smaller things we can do to make the experience better. &amp;nbsp;Eg. even when generating a dump on the first-pass, there is still the issue of which context should be presented to the user - the current thread context, or the exception context (.ecxr you mentioned). &amp;nbsp;Ideally VS will automatically switch to the exception context. &amp;nbsp;I'm not sure if it does that today.&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9241398</link><pubDate>Fri, 19 Dec 2008 11:55:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9241398</guid><dc:creator>kajo0011</dc:creator><description>&lt;p&gt;Hi &amp;nbsp;rmbyers!&lt;/p&gt;
&lt;p&gt;In my case .ecxr works perfectly!!! Try it with my sample! And use WinDbg 6.7.5.0. It *immediately* displays the correct stack trace! Because I use the expParam to pass the *correct* stack to MiniDumpWriteDump!&lt;/p&gt;
&lt;p&gt;Please use my example and you will see that the minidump is *correctly* written and WinDbg does *correctly* show the callstack. Only VS2010CTP does not!&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blog.kalmbachnet.de/files/MiniDumpTest1.zip"&gt;http://blog.kalmbachnet.de/files/MiniDumpTest1.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is *no* problem! Neither with unmanaged nor with managed code! Please try it! The problem is only that VS does not read the correct context from the minidump!&lt;/p&gt;
&lt;p&gt;And today VS2008 _correctly_ switches to the .ecxr contect for unmanaged code! In VS2010CTP the new managed-minidump dupport does this *not*!&lt;/p&gt;
&lt;p&gt;You minidump-support is currently useless.&lt;/p&gt;</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9249502</link><pubDate>Tue, 23 Dec 2008 10:50:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249502</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes my explanation was overly simple (the stack isn't really &amp;quot;unwound&amp;quot; just made unavailable). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I've written this up in detail in a new blog entry here: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/rmbyers/archive/2008/12/22/getting-good-dumps-when-an-exception-is-thrown.aspx"&gt;http://blogs.msdn.com/rmbyers/archive/2008/12/22/getting-good-dumps-when-an-exception-is-thrown.aspx&lt;/a&gt;. &amp;nbsp;Pay special attention to the second-last paragraph - that's especially for you.&lt;/p&gt;
&lt;p&gt;The short answer is that VS doesn't support .cxr for native or managed (for both live and dump debugging), but even if it did there would be problems with managed code due to the GC (basically a CLR limitation).&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9249506</link><pubDate>Tue, 23 Dec 2008 10:52:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249506</guid><dc:creator>rmbyers</dc:creator><description>&lt;p&gt;By the way, thanks for all your questions and sample code on this. &amp;nbsp;It's helped to convince me we should try harder to do more here. &amp;nbsp;I'm talking with the CLR exceptions team about some things we might do in this space (and also improve the experience when debugging exceptions that are rethrown), but don't expect anything in CLR v4 (we're locking down to ship it now).&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt; &amp;nbsp; Rick&lt;/p&gt;
</description></item><item><title>re: CLR 4.0 advancements in diagnostics</title><link>http://blogs.msdn.com/rmbyers/archive/2008/10/30/clr-4-0-advancements-in-diagnostics.aspx#9249909</link><pubDate>Tue, 23 Dec 2008 15:38:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249909</guid><dc:creator>kajo0011</dc:creator><description>&lt;p&gt;Thanks for your answer... I hope that somtime in the future the CLR team will support &amp;quot;full-blown-diagnostic-support&amp;quot; ;)&lt;/p&gt;</description></item></channel></rss>