If broken it is, fix it you should

Using the powers of the debugger to solve the problems of the world - and a bag of chips    by Tess Ferrandez, ASP.NET Escalation Engineer (Microsoft)

Posts
  • If broken it is, fix it you should

    ASP.NET Case Study: Lost session variables and appdomain recycles

    • 107 Comments
    Last night I got a question from one of the readers of the blog that went like this: “We are facing a problem that i cannot understand, every now and than i see that my app domain is recycled (i have a log in the application_end), I check the IIS logs and i don't see a restart of IIS and i know that no one is changing configuration (web.config). I wanted to know if you know of any way that i can pinpoint the reason for that app domain to die? The application pool that i am using...
  • If broken it is, fix it you should

    ASP.NET Memory: If your application is in production… then why is debug=true

    • 86 Comments
    Statement “Ensure that the debug="false" on the <compilation> element in the web.config file of each and every ASP.NET application on the server. The default during development is "true" and it is a common mistake to allow this development time setting to find its way onto production servers during deployment. You don't need it set to true in production and it often leads to memory overhead and inefficiencies.” What problems does leaving debug=true cause? There are three main...
  • If broken it is, fix it you should

    ASP.NET 2.0 Crash case study: Unhandled exceptions

    • 84 Comments
    For a long time all my case studies have been on 1.1. it’s time to venture out in 2.0 land and look at what may seem like a 2.0 specific issue. I say “may seem” because this case study will only directly crash if you are using 2.0, but as you’ll learn later the problem existed in 1.1 and 1.0, it was just way harder to track down. Problem description: Once in a while ASP.NET crashes and we see events in the system event log like this one Event Type: Warning Event Source: W3SVC...
  • If broken it is, fix it you should

    .NET Memory Leak: XmlSerializing your way to a Memory Leak

    • 60 Comments
    I hate to give away the resolution in the title of the blog since it takes away a lot of the suspense:) but I can't figure out a better way to name the blog posts and still keep them nicely searcheable so here we go... This one has come up a number of times, in fact so many that I finally wrote a kb article on it a couple of years ago. I'll give you the link at the bottom of the blog post. I specifically remember one time when I had a case on this. It was a Saturday at 2 am and this customer...
  • If broken it is, fix it you should

    How can I make you learn and benefit from my Blog? and how can I learn from you?

    • 58 Comments
    Summer is almost over and a new season of heavy work is beginning.  I wanted to take this opportunity to start on a new page and make sure that I’m spending my cycles doing the right things.  I’ve been blogging for almost 3 years now and throughout the blogs life I’ve been blogging pretty much the same way, trying to show examples of where me and fellow developers have gotten into situations that have caused crashes, memory leaks, exceptions, hangs etc., so that we can all learn from the...
  • If broken it is, fix it you should

    .NET Memory usage - A restaurant analogy

    • 57 Comments
    My favourite author Simon Singh is a wiz at analogies. In his book The big bang he explains concepts like the doppler effect and the theory of relativity using analogies with frogs and trains that makes it not only easy to understand but you will remember them forever because of the picture they paint in your head. The other day at work I heard one of my colleagues explaining memory usage and why you get out of memory exceptions to one of his customers using a restaurant analogy. I've talked about...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 1: Hang - Review

    • 54 Comments
    Earlier this week I published the first .NET Debugging Demos Lab. If you haven't downloaded and tried it out you can get it here . This is a review of this lab with answers to the questions and comments inline in red. Note: results and thread IDs will vary depending on how fast you click and what machine you have and what threads the request happen to run on, so I will answer with the results from my dual-proc W2k3 machine. Reproduce the problem: 1. Browse to http://localhost/BuggyBits/FeaturedProducts...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 1: Hang

    • 51 Comments
    This is the first in a series of about 10 labs on .NET debugging. The lab will use a site called BuggyBits, and as the name suggests the bits are extremely buggy. To get started, follow the setup instructions posted here . I have a feeling that these hands-on-labs may generate a lot of questions and although I will try to answer any questions posted in the comments I can’t promise to answer them all so please feel free to answer other readers comments if you know the answer, and make sure that...
  • If broken it is, fix it you should

    Are you aware that you have thrown over 40,000 exceptions in the last 3 hours?

    • 51 Comments
    This may seem like a preposterous statement, but unfortunately it’s all too common. In my work I go through a lot of dumps, somewhere in the neighborhood of 5-20 in a day:) Since the information is readily available to me, I usually do a quick check for the number of exceptions that the application has thrown and what types of exceptions they are so I can make the customers aware. More often than not, the applications are throwing a lot more exceptions than the developers expected, or they were...
  • If broken it is, fix it you should

    .NET Memory Leak Case Study: The Event Handlers That Made The Memory Baloon

    • 45 Comments
    It always feels like issues come in clusters. One week we get tones of cache related cases, next week everyone is stuck in some lock and so on. Lately I have had a number of issues where there were memory leaks related to event handlers. Problem description We have a pretty easy to repro memory leak, even with very few users memory grows at a high rate and the memory is never released. The usual suspects are eliminated, i.e. we know that the app doesn’t cache much or store much or anything...
  • If broken it is, fix it you should

    .Net memory leak: Unblock my finalizer

    • 44 Comments
    This time I figured I'd talk about an issue that spans all three debugging scenarios, hangs, memory issues and crashes... yummy:) But first off let me just share a link i found on Mike Stall's debugging blog , the source for .net 2.0 (rotor). Very handy if you want to take a closer look at how things are implemented in the framework. Edit 2010-03-08: Changed the link to the download for the CLI source Problem statement: The application runs fine for hours on end, then suddenly memory...
  • If broken it is, fix it you should

    Validation of viewstate MAC failed after installing .NET 3.5 SP1

    • 44 Comments
    After installing .NET 3.5 SP1 you may get Validation of viewstate MAC failed exceptions when doing post backs on ASP.NET pages Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 2: Crash - Review

    • 43 Comments
    Hi all, I realize that you probably haven't all had a chance to look at the Crash lab yet, considering I just published it on Friday but here is the review for it. I have to say that considering the amount of downloads for the buggy bits site I am a bit surprised with the lack of questions about the labs. Perhaps they were too easy, or perhaps people just haven't had the time to go through them yet... either case, feel free to ask questions or comment on the labs, even questions that aren't directly...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 3: Memory - Review

    • 40 Comments
    I was reading this post about spam ping-bots from OldNewThing and it makes me a bit mad because they just steal your content to make money, and create a lot of spam in my mailbox making it harder for me to find the real comments/track-backs. What is even more messed up is that some of these sites ask you to sign in and some even have you pay for content that someone else (like me) wrote:) amazing... so anyways, if you read this from some place other than http://blogs.msdn.com/Tess , an RSS reader...
  • If broken it is, fix it you should

    10 years 10 lbs of M&Ms

    • 40 Comments
    This week I turned 10 in Microsoft years which according to MS tradition means that you need to bring in 10 lbs of M&Ms to the office to treat your co-workers with as they stop by and reminisce about the past 10 years :)  We don’t really have M&Ms in the stores in Sweden so I had to substitute for my favorite Swedish candy instead. 10 years is quite some time, but it feels even longer in our business when you think about how much happens with technology in 10 years. When I first started...
  • If broken it is, fix it you should

    Learning .NET debugging

    • 38 Comments
    I often get questions like How do I learn .net debugging? What books should I read? Where can I find more information? I know everyones learning style is different so this might not be the best way for you, but the way I try to learn things is by "teaching". For example the way I started out with .net debugging was by putting together a really silly .net debugging web cast series with one of my colleagues. Looking back at them now they make me laugh, both because seeing yourself on video is just...
  • If broken it is, fix it you should

    A Case of Invalid Viewstate

    • 38 Comments
    Last week I was helping a colleague of mine with a viewstate case that turned out to be pretty interesting... Scenario The customer was getting events similar to the following in the eventlog and needed to know why they occurred Event Type: Information Event Source: ASP.NET 2.0.50727.0 Event Category: Web Event Event ID: 1316 Date: 2007-06-11 Time: 09:48:02 User: N/A Computer: MYMACHINE Description: Event code: 4009 Event message: Viewstate verification failed. Reason: The viewstate...
  • If broken it is, fix it you should

    .NET Garbage Collector PopQuiz - Followup

    • 36 Comments
    It was really exciting to see that so many people answered the .NET GC PopQuiz , especially seeing that so many had great answers. Perhaps the questions were too easy:) The reason I posted the pop quiz in the first place is that, as opposed to Phil, who commented that none of this should really matter to the developer:), I do think that a good understanding of what happens behind the scenes when you are programming on top of a lot of code that you don't control, is important since it tells you...
  • If broken it is, fix it you should

    .NET Hang Debugging Walkthrough

    • 35 Comments
    I have talked about a number of different hang/performance issues in my posts. This post is a generic debugging walkthrough for hangs. It applies to all types of .NET processes and to some extent also to non-.net processes even though it has some .net specific items. Define the hang/performance issue The first step in troubleshooting a performance issue/hang of any kind, whether it is .NET or native is to find out what we are dealing with and what the expected resolution is. Asking yourself...
  • If broken it is, fix it you should

    Request for feedback

    • 34 Comments
    Not sure if anyone is reading this blog, but if you are and there is something specific you want me to blog about please let me know. On my TODO list right now i have Debugging managed memory leaks Automating debugging with .shell and .foreach etc. Debugging .net 2.0 applications but I want this blog to be a useful resource, so rather than just blogging about what interests me, let me know what interests you:). And I'm also interested in getting feedback on if my blog posts are...
  • If broken it is, fix it you should

    .NET Memory Leak: To dispose or not to dispose, that’s the 1 GB question

    • 33 Comments
    I was looking at a memory dump recently for an issue where the process would grow to over 1 GB and return OutOfMemory Exceptions. Debugging the issue: A full user dump of the w3wp.exe process was taken with debug diag 1.1 when memory was really high. If you are reading this and have no clue what debug diag is, how to get dumps with it, or use leak tracking, here is the download and the usage instructions . The dump itself was 1.34 GB which is basically the memory we have committed (used) so it was...
  • If broken it is, fix it you should

    Questions on application domains, application pools and unhandled exceptions

    • 33 Comments
    I got an email with some questions around application domains, application pools and unhandled exceptions from a developer that was frequently seeing his website crash, and also had some related issues with session loss in his application. I have written before about unhandled exceptions and session loss due to appdomain restarts but I thought his questions would serve as a nice refresher. From what i read, my understanding is that a website has an app pool associated with it. This app pool...
  • If broken it is, fix it you should

    Debugging Silverlight applications with windbg and sos.dll

    • 33 Comments
    If you have hangs, performance, memory issues, exceptions or crashes in Silverlight applications you can debug them using windbg and sos just like you would if the issues occurred in other .net applications. The difference is that Silverlight in IE runs a subset of the framework where the main dll is coreclr.dll rather than mscorwks.dll so you can't use the regular 2.0 version of sos.dll that you can find in the framework directory. Instead you can install the Silverlight Developer Runtime from...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 2: Crash

    • 31 Comments
    It was nice to see that so many people downloaded the demo site already and checked out the lab instructions for the first lab, and thanks to Pedro for pointing out that the original demo site required .NET Framework 3.5... I've changed it now so the one that you can download from the setup instructions page should not require .Net Framework 3.5. (Even though I would encourage you to download 3.5 and play around with it anyways:)) Here comes lab 2, a crash scenario on the BuggyBits site. Previous...
  • If broken it is, fix it you should

    .NET Debugging Demos Lab 3: Memory

    • 30 Comments
    TGIF, almost time for the weekend... but before you leave, here is lab 3. Todays debugging puzzle will be a Memory investigation. This time we are going to stress the BuggyBits site to create a high memory usage situation and figure out what caused it. This lab is a bit lengthier because I wanted to show various aspects of a memory investigation. Once you know the relationship between the numbers in the dump and perfmon etc. you can often skip some parts, but if it is possible to gather I would...
Page 1 of 11 (252 items) 12345»