So, I am typing some value for a file name in the project palette in my product and I happen to type an invalid character in there which I don’t know about. I click on a button in the UI that should bring up a popup. Clicking on the button commits my change to the file name (since I didn’t hit enter after typing the new name expecting it to commit on a focus change). I get an error dialog saying that the file name is invalid. I hit Ok and my product crashes. I thought about it and then I realized I hit a jackpot since there were several similar workflows in the UI that offered the opportunity to get into this state (e.g. committing an invalid value in the Property Inspector and other palettes, etc). The issue turned out to be a platform bug in which the platform (.NET 3.0) tries to set focus to the popup, but first calls the application (in this case my product) back to commit values in any keyboard focused edit controls. My product sometimes displays UI to the user regarding the value they entered in the edit control (i.e. error in their input, or warning about the value they are about to set). This error/warning UI, in turn, causes the user-invoked popup to be destroyed during the callback, so when control returns to the platform’s focus code, they crash because the popup they were trying to set focus to is gone. My product had to work around this issue for one release. It’s been fixed in the platform (.NET 3.5) and the workarounds in my product are now gone, but I’ve still used this scenario to find other bugs in the product code.

-- Jeetendra Kukreja

 

Do you have a bug whose story you love to tell? Let me know!