June, 2009

  • The Old New Thing

    2009 mid-year link clearance

    • 19 Comments

    Time for the semi-annual link clearance.

    And, as always, the obligatory plug for my column in TechNet Magazine:

  • The Old New Thing

    Microspeak: The plan for the plan

    • 10 Comments

    I ran across an old document that contained a phrase I hadn't heard before:

    The Plan for the Plan for the XYZ Team

    Summary

    XYZ is at ZBB and we are now at a recall class only bug bar until RTM. The team has also started working on a plan for a plan to address the requests made from the XYZ Leadership Team several months ago. Details of the planning ...

    ...

    3. Bob would like a more concrete plan for a plan. Milestone breakdowns, entry/exit dates, etc...

    ...

    Plan for a Plan

    We established some deliverables to begin creating the plan for a plan:

    Development/Design Code Review
    Due date: Next week
    Prerequisites: Dev work items

    Alice will drive this to get sanity checks from other developers about overall design.

    ...

    There's a lot of Microspeak in that snippet. We've got ZBB, recall class, deliverables, to drive, and the phrase for today: plan for a plan/the plan.

    The phrase "plan for a plan" makes me think that you're trying to decide how you're going to decide what you're going to to. This is different from "early stages of planning", because when you're in the early stages of planning, you're actually planning something, even though you're still in the exploratory stage. On the other hand, planning for planning sounds like you don't even know how to plan, and you have to go learn how to do it again.

    It reminds me of that Dilbert cartoon where Dilbert taunts the pointy-haired boss by suggesting that it would be rash to have a premeeting without planning it.

  • The Old New Thing

    Learning to lie: Early forays

    • 25 Comments

    Some time ago, I was visiting a family with small children, and I found the two-year-old middle child with a marker in her hand suspiciously close to some fresh marks on the living room couch. The following conversation ensued:

    "Who drew on the couch?"

    My older sister.

    "Your older sister isn't home."

    The baby.

    "The baby can't reach this."

    The dog.

    "You don't have a dog."

  • The Old New Thing

    If you want to consume all the virtual address space, well, then go ahead and consume it, you don't need my help

    • 9 Comments

    Commenter Matthew Chaboud asks if there's an easy way to consume all the virtual address space below 4GB, short of, well, actually allocating it. "It seems like there should be a cleaner way to do this."

    If you want to consume all the virtual address space, then call VirtualAlloc until you turn blue. Programs shouldn't care what address they get back from a memory allocation function; they should handle values below 2GB and above 2GB with equal facility.

    It's not like there's a ConsumeAllAvailableVirtualAddressSpaceAndExhaustTheHeap function. (Is there a AllocateAllRemainingDiskSpaceAndFillExistingFilesWithZeroes function?) What would be the point of such a function? Once you call it, you have run out of memory!

    If Mr. Chaboud is talking about keeping programs away from bottom 4GB of virtual address space on a 64-bit machine, then a much easier way to do this is to set the AllocationPreference configuration setting to specify that memory should be allocated from high addresses first. (But I don't think that's the scenario that prompted the original question, because on 64-bit Windows, the default heap is above the 4GB boundary, so there would be no need to exhaust the heap in order to consume the memory at virtual addresses below 4GB.)

    Correction: Pavel Lebedinsky points out that the default heap is below 4GB on 64-bit machines. It used to be above the 4GB boundary on earlier versions of 64-bit Windows, but I guess they changed it.

  • The Old New Thing

    John Swansburg deftly declines the fine print disclaimer on his Heelys

    • 11 Comments

    Before field-testing his Heelys for a report in Slate, John Swansburg reads the legal disclaimer and declines it.

  • The Old New Thing

    The thread that gets the DLL_PROCESS_DETACH notification is not necessarily the one that got the DLL_PROCESS_ATTACH notification

    • 11 Comments

    The thread that gets the DLL_PROCESS_DETACH notification is not necessarily the one that got the DLL_PROCESS_ATTACH notification. This is obvious if you think about it, because the thread that got the DLL_PROCESS_ATTACH notification might not even exist any longer when the DLL is unloaded. How can something that doesn't exist send a notification?

    Even so, many people fail to realize this. You can't do anything with thread affinity in your DLL_PROCESS_ATTACH or DLL_PROCESS_DETACH handler since you have no guarantee about which thread will be called upon to handle these process notifications. Of course, you're not supposed to be doing anything particularly interesting in your DLL_PROCESS_ATTACH handler anyway, but things with thread affinity are doubly bad.

    The classic example of this, which I'm told the Developer Support team run into with alarming frequency, is a DLL that creates a window in its DLL_PROCESS_ATTACH handler and destroys it in its DLL_PROCESS_DETACH handler. Now, creating a window in DllMain is already a horrifically bad idea since arbitrary code can run during the creation of a window (for example, there may be a global hook), but the lack of a thread guarantee makes it downright insane. The DLL calls DestroyWindow in its DLL_PROCESS_DETACH handler, but since that notification comes in on a thread different from the one that received the DLL_PROCESS_ATTACH notification, the attempt to destroy the window fails since you must call DestroyWindow from the same thread that created it.

    Result: The DLL's attempt to destroy its window fails, a message comes in, and the process crashes since the window procedure no longer exists.

  • The Old New Thing

    News flash: Children are influenced by advertising

    • 27 Comments

    Anything in a McDonald's wrapper tastes better, according to children ages 3 to 5. Even something like carrots taste better if you put them in a McDonald's wrapper or cup.

  • The Old New Thing

    First, try reading the error message, episode 2: Even programmers see error messages without reading them

    • 22 Comments

    I will occasionally note that users don't read error messages; they just click Cancel. And the phenomenon isn't just restricted to naïve users. Even programmers ignore error messages. All they see is "Blah blah blah an error occurred."

    For example, there's this message that appeared on a peer-to-peer discussion group:

    I tried to submit an update to our database and I got this error. What does it mean? Is the error on the client or the server?

    Opening transaction 34508.
    Locking record 14 for update.
    Updating record 14 in table BLUECHEESE.
    Operation failed.
    write: The file or directory is corrupted and unreadable.
    

    When I try to view the record to see whether my update made it, I get this error:

    The database may be corrupt; it requires administrator attention.
    To protect the database, it has been taken offline.
    

    I'm no expert here, but it looks like a write operation failed because the file or directory is corrupted and unreadable. Since you're updating a record on the server, it's probably a corruption problem on the server. (After all, there's no change taking place on the client. The client is just asking the server to do the work.)

    And the second error message seems to suggest that the database may be corrupt and requires administrator attention. As a precautionary measure, the database took itself offline so the corruption can't spread. I'm pretty sure that's a server-side thing, since the database is on the server.

  • The Old New Thing

    Spam trackback attack week 3 statistics

    • 10 Comments

    The people who run this site think they have a handle on the trackback spam attack that raged for three and a half weeks. All the bad IP addresses have been blocked, and hopefully we didn't lose any babies with the bathwater.

    Here are the statistics for the final wave:

    Site From To Count Rate (pings/hr)
    www.englishsoftware.info 6/10/2009 02:56 AM 6/10/2009 02:56 AM 1
    accounting.financenewstoday.com 6/10/2009 08:34 AM 6/10/2009 08:34 AM 1
    blog.a-foton.ru 6/10/2009 09:20 AM 6/10/2009 09:20 AM 1
    castironbakeware.info 6/11/2009 07:20 PM 6/11/2009 07:57 PM 27 42
    backyardshed.info 6/11/2009 07:59 PM 6/11/2009 08:11 PM 3 10
    weakbladder.info 6/12/2009 03:51 PM 6/12/2009 05:48 PM 38 19
    greenteafatburner.info 6/12/2009 06:00 PM 6/12/2009 08:02 PM 89 43
    besteyecreamsite.info 6/12/2009 08:04 PM 6/12/2009 09:02 PM 33 33
    jointpainreliefs.info 6/12/2009 09:07 PM 6/12/2009 10:12 PM 28 25
    insomniacuresite.info 6/12/2009 10:19 PM 6/13/2009 12:00 AM 92 54
    insomniacuresite.info 6/13/2009 12:49 AM 6/13/2009 12:56 AM 5 34
    menopausereliefsite.info 6/13/2009 12:58 AM 6/13/2009 01:33 AM 15 24
    cellulitecreamsite.info 6/13/2009 01:43 AM 6/13/2009 03:38 AM 159 82
    toenailfungusite.info 6/13/2009 03:39 AM 6/13/2009 05:09 AM 109 72
    hairgrowthproducts.info 6/13/2009 05:11 AM 6/13/2009 06:00 AM 61 73
    quickdietsite.info 6/13/2009 06:02 AM 6/13/2009 07:24 AM 114 83
    outdoordecoration.info 6/13/2009 02:26 PM 6/13/2009 03:23 PM 41 42
    onlyoutdoorrugs.info 6/13/2009 04:20 PM 6/13/2009 04:46 PM 21 46
    ebeanbagchair.info 6/13/2009 05:33 PM 6/13/2009 05:48 PM 10 36
    homelightingconcept.info 6/13/2009 06:42 PM 6/13/2009 07:02 PM 32 93
    firepitidea.info 6/13/2009 08:08 PM 6/13/2009 08:27 PM 35 107
    wheelbarrowstyle.info 6/13/2009 09:19 PM 6/13/2009 09:25 PM 13 120
    barstoolsite.info 6/13/2009 10:25 PM 6/13/2009 10:48 PM 25 63
    gardendecordesign.info 6/13/2009 11:46 PM 6/14/2009 12:02 AM 23 83
    fancyporchswing.info 6/14/2009 01:17 AM 6/14/2009 01:27 AM 16 90
    thestoragebench.info 6/14/2009 02:52 AM 6/14/2009 03:21 AM 31 62
    www.baby-parenting.co.uk 6/14/2009 03:22 AM 6/14/2009 03:22 AM 1
    thestoragebench.info 6/14/2009 03:23 AM 6/14/2009 03:29 AM 8 70
    gardenstatuesgalore.info 6/14/2009 04:30 AM 6/14/2009 04:54 AM 21 50
    adirondackchairshub.info 6/14/2009 06:06 AM 6/14/2009 06:40 AM 40 69
    cutebirdbaths.info 6/14/2009 07:46 AM 6/14/2009 08:10 AM 22 53
    patiocushionsource.info 6/14/2009 09:16 AM 6/14/2009 09:23 AM 15 120
    patiosetsite.info 6/14/2009 10:04 AM 6/14/2009 10:04 AM 2
    edebtsettlementprogram.info 6/15/2009 09:51 AM 6/15/2009 10:27 AM 27 43
    mydebtconsolidator.info 6/15/2009 12:29 PM 6/15/2009 01:46 PM 81 62
    debtsolutionsnow.info 6/15/2009 04:52 PM 6/15/2009 06:21 PM 69 46
    einternetmarketingtools.info 6/15/2009 09:04 PM 6/15/2009 09:53 PM 33 39
    www.baby-parenting.com 6/15/2009 09:53 PM 6/15/2009 09:53 PM 1
    einternetmarketingtools.info 6/15/2009 10:01 PM 6/15/2009 10:43 PM 26 36
    unemploymentofficeresource.info 6/16/2009 12:25 AM 6/16/2009 01:20 AM 51 55
    workfromhomecareer.info 6/16/2009 04:10 AM 6/16/2009 06:26 AM 89 39
    blog.a-foton.ru 6/16/2009 09:29 AM 6/16/2009 09:29 AM 1
    fixmycrediteasily.info 6/16/2009 06:23 PM 6/16/2009 07:43 PM 56 41
    lowcostcarinsurances.info 6/16/2009 09:15 PM 6/16/2009 10:12 PM 100 104
    topalternativedating.info 6/16/2009 11:58 PM 6/17/2009 01:10 AM 115 95
    buildesignwebpage.com 6/17/2009 06:07 PM 6/17/2009 06:08 PM 4 180
    patiosetsite.info 6/17/2009 07:03 PM 6/17/2009 07:24 PM 10 26
    patioumbrellasource.info 6/17/2009 08:31 PM 6/17/2009 09:08 PM 34 54
    buildesignwebpage.com 6/17/2009 09:12 PM 6/17/2009 09:12 PM 3
    thebasketballhoop.info 6/17/2009 11:30 PM 6/18/2009 12:01 AM 43 81
    pooltoysite.info 6/18/2009 01:31 AM 6/18/2009 02:20 AM 111 135
    imagesarchive.org 6/18/2009 04:23 AM 6/18/2009 04:23 AM 1
    buildesignwebpage.com 6/18/2009 02:06 PM 6/18/2009 02:06 PM 1
    outdoordecoration.info 6/18/2009 08:53 PM 6/18/2009 09:43 PM 47 55
    onlyoutdoorrugs.info 6/18/2009 09:51 PM 6/18/2009 10:13 PM 18 46
    ebeanbagchair.info 6/18/2009 10:13 PM 6/18/2009 10:27 PM 7 26
    homelightingconcept.info 6/18/2009 10:30 PM 6/18/2009 10:55 PM 47 110
    firepitidea.info 6/18/2009 10:55 PM 6/18/2009 11:17 PM 55 147
    wheelbarrowstyle.info 6/18/2009 11:18 PM 6/18/2009 11:27 PM 29 187
    barstoolsite.info 6/18/2009 11:28 PM 6/19/2009 12:00 AM 86 159
    gardendecordesign.info 6/19/2009 12:00 AM 6/19/2009 12:26 AM 57 129
    fancyporchswing.info 6/19/2009 12:27 AM 6/19/2009 12:43 AM 32 116
    thestoragebench.info 6/19/2009 12:43 AM 6/19/2009 01:29 AM 84 108
    gardenstatuesgalore.info 6/19/2009 01:30 AM 6/19/2009 01:56 AM 38 85
    adirondackchairshub.info 6/19/2009 01:56 AM 6/19/2009 02:34 AM 69 107
    cutebirdbaths.info 6/19/2009 02:36 AM 6/19/2009 03:03 AM 38 82
    patiocushionsource.info 6/19/2009 03:04 AM 6/19/2009 03:12 AM 16 113
    patiosetsite.info 6/19/2009 03:13 AM 6/19/2009 03:27 AM 5 17
    patioumbrellasource.info 6/19/2009 03:36 AM 6/19/2009 04:08 AM 14 24
    thebasketballhoop.info 6/19/2009 04:15 AM 6/19/2009 04:46 AM 43 81
    edebtsettlementprogram.info 6/19/2009 06:28 AM 6/19/2009 07:10 AM 35 49
    mydebtconsolidator.info 6/19/2009 07:14 AM 6/19/2009 09:10 AM 216 111
    debtsolutionsnow.info 6/19/2009 09:14 AM 6/19/2009 11:24 AM 151 69
    wireless-mouse.info 6/20/2009 06:14 PM 6/20/2009 06:14 PM 1
    blog.a-foton.ru 6/22/2009 08:16 AM 6/22/2009 08:16 AM 1
  • The Old New Thing

    Yet another experiment in motivating people to find and fix bugs

    • 11 Comments

    Everybody has probably heard about some project where management decided to motivate testers and programmers by rewarding testers for finding bugs and programmers for fixing them. In the absence of high ethical standards, this can devolve into the situation known to Dilbert fans as I'm gonna write me a new minivan.

    I experimented with this idea once, over a decade ago. Well, not exactly this idea, but a variation of it: For each bug in my code which I fixed, I paid the tester who found it.

    The risk here would be that I would intentionally resolve bugs as INVALID (or WONTFIX or anything other than FIXED) in order to avoid paying the penalty for fixing them, but I like to think that I made my decisions on their technical merits rather than based on my pocketbook. Since the tester saw the bug resolution, there was a degree of oversight: If I used bogus bug resolutions to avoid the bug fixing penalty, the tester would just reopen the bugs. The amount of the reward varied based on the quality of the bug, so that encouraged testers to focus on finding good bugs instead of weenie ones.

    I think I paid out a few dozen bug rewards. (It was a small project.)

Page 1 of 5 (41 items) 12345