Welcome to MSDN Blogs Sign in | Join | Help

Notes from a dark corner

Debugging ASP.NET, the CLR and anything that uses clock cycles.

News

  • These postings are provided as is with no warranties, and confers no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
Extracting a request from a netmon trace

The other day I needed to quickly get the entire response being sent by a web server so I could get an understanding of why it was causing the browser so much trouble when trying to render it.

All I had at that moment was the netmon trace on the client side. I knew the entire response must be in there somewhere but it was spread across about 22,000 packets!

I know there are some smarter tools out there for doing this but what I came up with was to use my old favourite - Logparser:

logparser -i:NETMON "SELECT Payload INTO Response.htm FROM trace.cap WHERE Ack = 123456789" -o:TPL -tpl all.tpl

where 123456789 was the AcknowledgementNumber of the response which I got from the first packet of the response.

where all.tpl just contains this:

<LPHEADER></LPHEADER><LPBODY>%Payload%</LPBODY><LPFOOTER></LPFOOTER>

It's a bit quick and dirty and probably included the TCP payload header as well as the HTTP payload but it did the job.

 

Doug

A long lost friend

I was looking for one of my blog posts the other day that talks about how ASP.NET uses Windows memory. I was hunting and hunting and could not find it anywhere. I finally realised that at some point I had somehow left it in an unpublished state (probably after editing some minor type or something). So all this time it has been AWOL. Anyway, no more, it's back!:

ASP.NET - how it uses Windows memory

HTH

Doug

"Hotfix Download Available"

One of the banes of my life and that of my customers for many years has been the issue of getting hold of hotfixes. Most hotfixes that Microsoft release are produced, initially, in response to a particular customer request where they really, really need the fix doing. So the product team produces the fix, packages it up and it is then available for other customers. However, because it goes through much less testing cycles than, say, a service pack, we are wary of it becoming too widely distributed and installed "in the hope that it fixes a problem" rather than being installed because the bug concerned is definitely what you are encountering.

So, traditionally (and still, as a rule) you had/have to contact Microsoft supported to get the fix. That way we could track who got the fix so that if a problem was found with it we could follow up with those people, ensure they got the right fix and help them ensure it was really the right fix for them.

In recent times there have been a number of moves to try and make hotfixes more readily available.  For several years our Premier customers have been able to download them directly via the special web portal dedicated to them. More lately, a pilot program made some developer related hotfixes available via the "Connect" website. And more recently than that a number of fixes have been posted to the MSDN Code Gallery.

Now it looks like we are experimenting with another way, which I really like the look of. I came across a number of hotfix articles with this new feature; here are some examples:

A hotfix is available to add a new time zone in Venezuela (GMT-4:30) for the year 2007 in Windows XP, Windows Server 2003, and Windows Vista
Graphics performance can be improved in certain multiple-GPU scenarios on a Windows Vista-based computer
Hotfix for Windows XP that adds support for SDHC cards that have a capacity of more than 4 GB

 

If you take a  look at any of these, right at the top you will see this (the red box is my highlight):

 

image

 

 

When you click through you see a nice list of fix packages available, including the various language versions:

 

image

 

and then at the bottom a form to provide the email address and a captcha field to avoid bot harvesting of hotfixes:

 

image

 

If this is the future of hotfix delivery I like it a lot. It'll be interesting to see how this develops (I'm not involved in this internally - I presume it is some kind of pilot).

What do you think? Wouldn't it be great if all hotfixes were available self-service like this?

Doug

What's in Microsoft .NET Framework 3.5 SP1?

I made some comments about resources available for.NET 3.5 SP1 just after it first became available for download.

Now that the dust has settled a little bit I thought I would bring together a list of what's in it, good, bad and ugly..

A VERY extensive list of new features that Scott Guthrie described when it was in beta, including..

but also...

Changes to the ThreadPool class
JIT, NGEN, other code generation changes and application startup improvements
Managed code now allowed to run direct from a network share, just like Win32
Garbage collection notifications
A whole load of fixes that were previously released individually as hotfixes

 

Sadly also there were some bugs slipped in which Scott Hanselman has discussed.

In fact, quite a bit of my time recently has been taken up assisting some customers (that's my core job, in case you are not a regular follower of my blog) with addressing three particular regression issues. Fixes for these three are now available.

 

To get any of these fixes, you need to contact Microsoft Product Support and quote the Knowledge Base (KB) reference number. You will not have to pay for this. We do not charge for support in relation to hotfix delivery. PLEASE don't contact me directly. At time of writing this blog post the actual KB articles are not yet published (that takes a little longer). But that should not stop you calling support and requesting the fix if you need it.

 

Issue 1) This is an issue that broke Rhino Mocks and was also reported to the connect site. The symptom is a Fatal Execution Engine Exception when calling GetOptionalCustomModifiers or GetRequiredCustomModifiers.

A hotfix is now available. The KB reference is KB957541.

 

Issue 2) This is an issue with the optimizer in the 32 bit JIT compiler that was also reported on connect. Due to the nature of the bug, you should only see this one with managed C++ and as I indicated, only in 32-bit.

A hotfix is now available. The KB reference is KB957542.

 

Issue 3) This is an issue that was reported in relation to Sitecore. This is a nasty issue that can impact any code that deserializes generic types which have at least one static and one non-static member. For example it could affect an ASP.NET application that uses such types in conjunction with viewstate. The symptom will vary depending on the bitness of the application. 32-bit applications will enter an infinite loop. With one thread hitting the bug on a single CPU system this will mean 100% CPU. With one thread hitting the bug on a dual processor system that would mean 50% CPU. If two threads were to hit the same code path (not sure if that is actually possible as I think we are hitting this on a one-time-per-type code path) it would again mean 100% CPU on a two processor system. Etc. You get the picture.  Lots of CPU. 64-bit applications are likely to experience a TargetInvocationException wrapping an OutOfMemoryException (even though you are not out of memory).

A hotfix is now available. The KB reference is KB957543.

 

All three of these fixes will be included in the General Distribution Release (GDR) update for .NET Framework 3.5 SP1 that is being worked on right now, as described by Scott.

HTH

Doug

When copy and paste just aren't enough

In my job I often send my customers detailed instructions including things to run at the command line. Sometimes they don't work even though they look correct.

The plumber's mate has written a very helpful post that explains the problem that is often the explanation of why this happens.

Short answer is - if it doesn't work with copy+paste, try typing.

The other gotcha that often comes up is if, for example, you email someone a password and they select it by double clicking on the word (in Outlook) and both the password and a white space after it are selected. So when you copy it you are including a white space that is not really part of the password. But the person using it does not realise because when they paste the password into the password box the space becomes an asterisk.

HTH

Doug

Microsoft Hyper-V Server 2008

Microsoft has just released Microsoft Hyper-V Server 2008.

Note that this is not Microsoft Windows Server 2008 with Hyper-V. This is something different.

It " is a stand-alone hypervisor-based server virtualization product that allows customers to virtualize workloads onto a single physical server"

"It contains just the Windows hypervisor and other kernel components to support virtualization".

Download it, read the overview and FAQ.

 

Doug

Make sure your test data is right for the job

I helped out one of colleagues recently whose customer's application hit high CPU in one test environment but not another. The reason for that was that contrary to what they thought, the test data used in one environment was not the same as in the other. Simple problem, easy mistake, easy solution. But that was not the interesting aspect. The interesting bit was the data that caused the high CPU.

To troubleshoot the high CPU we got some memory dumps which is always a good, quick and dirty way to get insight into what is going on inside any process. Sure enough, there were a number of threads whose user mode time was increasing significantly between successive dumps and they all seemed to be doing similar things. The function names gave away that they were doing some kind of spell checking of email. A bit of poking around revealed the text that was being spell checked at the time:

"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor..."

Yes, it was the classical Lorem Ipsum text so fondly used by software testers and typographers everywhere.

So was there a lot of data? No. About 2500 words and it seemed to have taken about 45 seconds when we took the second dump. Is this unreasonable? Probably not. Think about it. You are running test data through an English language spell checker and not a single word of it is English. So every single word results in a parse through the entire dictionary before we go onto the next word. It's not surprising the CPU was getting thrashed.

This data might be appropriate for testing something like graphical elements of a web page design, or the transport elements of a communications systems but it's definitely the wrong data for testing a spell checker (unless of course you are specifically trying to measure what happens when no words match!).

Bye for now

Doug

Link: Useful article on ASP.NET Performance...

Over on the "ACE Team" blog there's a useful blog post with some performance tips for ASP.NET sites. The point about batch compilation and Debug="true" was certainly correct for version 1.1 but I think in ASP.NET 2.0 they are decoupled - so by default batch compilation remains on when debug="true". That was my own experience anyway.

It also links over to another very useful post which fulfils something a customer was asking me about just recently - how to "warm up" an ASP.NET site to ensure all pages are compiled (assuming you are not using the pre-compiled model).

And I cam across those two links by chance when I was reading this interesting post about correctly simulating browser caching when performing load tests with VSTS 2008.

HTH

Doug

Weird wireless adapter stuff: lesson learned - get the right drivers

My work laptop is a Dell Latitude D630 which I've set up to dual boot between Windows XP and Windows Server 2008 x64. I got it fairly recently so I am still "tweaking" it, trying to get everything working smoothly. The wireless adapter is an Intel 3945ABG (or so I'd thought) and although it appeared to work under XP it had this weird problem whereby it would not see any of the usual wireless networks I would expect it to see at home (it saw the ones at work ok) - mine, my neighbours etc for anything up to 20 minutes after a clean boot!!

I'd downloaded the drivers from the Dell support site which is usually pretty good but I hadn't found Vista x64 drivers So I went to the Intel site and pulled down the latest ones for the 3945ABG and installed them and it all worked like a dream first time, saw all the networks and everything. Curious thing was though that this time the adapter listed itself as the 4965AGN in device manager. The Dell site lists one download for 3965ABG and 4965AGN. But on my laptop the device came up as 3965ABG after installation under XP using the Dell package.

Hmm I thought. I noticed that the same driver package from Intel included both the x86 and x64 drivers so I went back and downloaded their package for XP as well and installed the x86 XP drivers on my XP installation. This time I got connectivity straight away again and again the adapter was now listed as 4965AGN in device manager.

So all that time I had an apparently working adapter but was probably using the wrong driver (even though the adapter claimed to be working correctly) and getting that weird failure to see the wireless networks until some random length of time elapsed.

If I run Intel's Wireless LAN identification utility it tells me it is the 4965AGN but I'm not sure whether that is interrogating the hardware or just the new driver I've installed.

Lesson learned: if you're getting weird stuff going on with hardware, double and triple check you've got the right drivers and go direct to the component vendor rather than the OEM that supplied your machine.

HTH

Doug

(1) If you can find drivers that are compatible with Vista SP1 then you effectively have drivers for Windows Server 2008.

.NET 3.5 Framework SP1 reference sources available

In mid January the first release of the .NET Framework 3.5 reference sources occurred. In mid February there was a minor update because Vista SP1 and Windows Server 2008 come with a slightly later build of the framework. Also in February Kerem Kusmezer and John Robbins released the NetMassDownloader to allow the pre-downloading of all the reference sources you need in one hit.

As John Robbins mused in his Random Thoughts on SP1 the other day the source indexed symbols and reference source for SP1 were strangely missing. Well, it just takes those guys over at the Reference Source Code Center a few extra days to catch up! As Steve Wilssens just announced over on their team blog, it's (mostly) now available. There are some extra assemblies(1) covered and WPF is still in the pipeline but debugging into the source certainly works from VS. I've not tried the NetMassDownloader as yet to see if that now works too. But I'm sure it will :-)

Happy debugging!

Doug

Note (1): the extras are:

System.Web.Routing.dll
System.ComponentModel.DataAnnotations.dll
System.Web.Abstractions.dll
System.Web.DynamicData.Design.dll
System.Web.DynamicData.dll
System.Web.Extensions.Design.dll

Internet Explorer 8 Beta 2 now available

As it says in the title of the post.

Read about it on the IE team blog.

Read about it on the portal page.

Read my previous post on IE8 compatibility.

Free Microsoft Developer and web design software for full time students

This sounds like a good deal. Free? Free? Sounds to good to be true :-). But it is.

If you are a full time student and into software development, take a look:

https://downloads.channel8.msdn.com/Overview.aspx

Check the site for details, but at time of writing the products included were:

  • Visual Studio 2008 Professional Edition
  • Visual Studio 2005 Professional Edition
  • Expression Studio (includes Web, Blend, Media and Design)
  • SQL Server 2005 Developer Edition
  • Windows Server 2003 R2 Standard Edition, with SP2
  • Cheers

    Doug

    Photosynth Synther hits the web! Get synthing!

    Late yesterday, the Microsoft Live Labs Photosynth team released an update to Photosynth as well as offering, for the first time, the ability to create your own "synths". Read all about it over at the Photosynth blog.

    If you've never heard of Photosynth nor seen it you may be wondering what it is. Well, imagine you visit somewhere and take a bunch of photos of "it" from lots of different angles. Then you let the Photosynth synther synth them. What this does is it breaks all the photos down into little fragments. These fragments are used to figure out where the pictures were taken from in relation to the subject and one another. These bits are all then stitched together into a single, semi-3-dimensional panorama that retains this spatial knowledge. You can then navigate around this panorama exploring the subject from different angles and also still view individual, original photos from the set too! And the great thing is this is done by using the power of your PC to generate the synth bits combined with the Photosynth web server farm to deliver the right images to your friends, family and the world! The other cool thing is that only the data needed to render the parts of the image you are currently looking at with the resolution and zoom level you currently have are downloaded (using a technology known as 'Seadragon') so your download experience is optimised.

    For everything you need to make your own synths and to explore some of the amazing synths already created by individuals and organisations like the BBC and National Geographic (who have done a great synth of Stonehenge in England) just visit the Photosynth.net web site. If you previously had a version of the Photosynth viewer installed it is recommended that you uninstall that first.

     

    Tips for viewing synths:

    • The better the graphics performance of your system the better your experience.
    • Don't forget to use the scroll wheel on your mouse - it gives you a Silverlight-deep-zoom-like experience.
    • My synths embedded on this page should work automatically but if not, try going to the the Photosynth.net web site first and viewing some synths, then come back to this page. You can find my synths using the Photosynth web site search feature.

     

    My first attempts

    To test it out, I took a bunch of photos of my home village of Sonning during the last week. They haven't scored too high on the Synthiness scale but I am quite pleased with the results nonetheless.

    To view and interact with each synth, click on the below thumbnail images to take you to the synth on the Photosynth site.

    Sonning Bridge

    image

    Sonning Lock

    image

    St Andrew's Church, Sonning

    image

     

    Tips for creating your own synths:

    • Read the "How to synth" guide
    • Make sure your photos overlap a reasonable amount (say 20% to 40%)
    • Take between 20 and 100 photos of the subject (or more if you are feeling snap happy)
    • Read the "Photography guide"
    • Remember that all synths are publc, so everyone will see them

    Read more about it:

    Hope you enjoy my synths for Sonning and happy synthing yourself!

    Doug

    PS If you like Photosynth, you might also like the demos of AutoCollage

    Understanding How You Use This Blog

    I meant to post this sooner but forgot. Better late than never. Note the below survey is only active until the 22nd of August. Not all my blog posts are written in work time but many are, so here is a short message from my sponsor, as the saying goes ....

    Understanding How You Use This Blog

    Greetings Blog Readers,

    My name is Ed Jolly, and I am a director in the Commercial Technical Support (CTS) organization at Microsoft. I am here to request a few minutes of your time.

    We would like to learn more about blog readership through a brief survey. This is an opportunity for us to better understand what is valuable to you and what you would like to see in the future.

    Below is a link that will take you to another website to complete the survey. Based on what we learn, we may request more feedback in future surveys like this.  When you open the survey, you will see a list of blogs that CTS engineers contribute to across many different products. We have not posted a listing of these blogs in the past, and I hope it helps you find other blogs that are helpful to you.

    The blog survey is completely anonymous.

    · Location: <LINK REMOVED AFTER SURVEY COMPLETE>

    · Availability:  Until August 22. You may receive a request to complete this survey through multiple RSS feeds. You need only to complete it one time.

    · Length: The survey can be a maximum of 11 questions.

    · Time: Less than 5 minutes (but providing more information in the open text fields may take a minute or two extra, improving our ability to understand your needs in these blogs).

    Thank you in advance for your time, participation and assistance.

    Ed Jolly (edjolly@microsoft.com)

     

    Thanks

    Doug

    Uninstalling .NET Framework 3.5 SP1

    You may have a need to uninstall .NET Framework 3.5 SP1, perhaps for testing purposes or because you find it causes you some specific issue with an application you have. If this is the case, it's important to realise that when you install .NET Framework 3.5 SP1 it actually updates the .NET 2.0 bits and the .NET 3.0 bits as well:

    image

    The thing to bear in mind is that .NET 2.0, .NET 3.0 and .NET 3.5 are not independent versions of the framework that can sit side by side or can co-exist without each other. The later versions are layered on top of the previous one. So you can have 2.0 without 3.0 and 3.5, and you can have 3.0 without 3.5 (but it still has 2.0 at its core) but you cannot have 3.5 without 3.0 and 2.0.

    I think of it like this:

    image

    And after you've installed .NET 3.5 SP1 you have this:

    image

    Also, since the updates for the "inner" parts of the framework are "slipstream" installs it means that when you uninstall the service pack you are not just removing the update, you are removing "the framework and the service pack".

    In other words, to get your system back to the state it was before the .NET Framework 3.5 SP1 install you need to remove .NET Framework 3.5 SP1, .NET Framework 3.0 SP2 and .NET Framework 2.0 SP2 and then, assuming you want to have .NET Framework 3.5 on there you need to then reinstall that. Took me about 20 minutes and one reboot altogether.

    Aaron Stebner has written a very useful blog post on doing this.

    HTH

    Doug

    More Posts Next page »
    Page view tracker