Partager via


Resolving Common Crashes Seen in Windows Mobile Watson data

I’m sure at one time or another you’ve all seen a certain happy window pop up on your phone. You know, the one that says a problem has occurred and asks if you’d be willing to tell Microsoft about it. If you haven’t seen it on your phone, well awesome, then maybe you’ve seen it on your desktop machine.

ScreenPic

What you might not know is that this window is generated by Watson, which is a component of Windows Error Reporting (WER). Specifically, Watson is the client-side executable that is activated when an unhandled exception occurs on your phone. Watson is responsible for preparing an error report (stack details, system information, variable information, etc), notifying the user about the error (happy window), and with the users consent sending the file to Microsoft (via data or ActiveSync). Assuming the user chooses to send the report, these encrypted files are then added to a WER database where they can be reviewed by Microsoft technical support personnel and Microsoft developers.

That’s definitely great, but if the reports all go to Microsoft how can you as a developer take advantage of this great data? Well, I’ve been in touch with the team responsible for reviewing and addressing these reports and we’d like to try to be more active about sharing with you. While we can’t share the reports themselves, what we can do is use this blog to talk about some of the most common crashes we see that result from coding and development issues. For this inaugural post, I’d like to take a quick look at three issues that have been showing up recently.

Issue #1: You’re passing THAT in the buffer!?

One issue that has showing up frequently concerns applications that try to retrieve text from a treeview item using the message TVM_GETITEM. For this scenario, the caller is responsible for passing a buffer and a buffer size to a TVITEM structure. The function TV_GetItem() then copies the amount of requested text to the output buffer using wcsncpy(). The reports we’re seeing are for crashes during this operation. Upon investigation it seems that there could be a mismatch between the buffer allocated and the buffer size specified by the application in the TVITEM structure. Buffer size should be specified in TCHARS, not in bytes. The following code fragment shows the reason for the crash.

CodePic

Issue #2: What did that buffer ask for again?

Another issue we’re seeing is with applications that are trying to retrieve column header text with the message LVM_GETCOLUMN. Similarly to the previous issue, the caller is responsible for passing a buffer and the buffer size in an LV_COLUMN structure. The function Str_GetPtrW() then copies the amount of requested text to the output buffer. It’s during this operation that we’re seeing crashes. Once again, it seems this issue is caused by a mismatch between the buffer allocated and the buffer size specified by the application in the LV_COLUMN structure. Within LV_COLUMN the buffer size must be specified in TCHRS as opposed to bytes, otherwise the application will exceed the bounds of the buffer.

Issue #3: .NET CF v1.0 is sooo 1990s

A final issue we’ve been seeing lately, concerns the .NET CF. Sometimes .NET CF v1.0 applications are installing MSCOREE1_0.DLL, which is the .NET CF v1.0 runtime. This version is no longer being shipped and should not be installed when the .NET CF v2.0 is installed. Although this issue is more general than the other two, we’ve seen this problem fairly frequently.

Please let us know if you found this information useful or, if you didn’t, what we can do to make it more relevant.

Comments

  • Anonymous
    April 20, 2009
    Good post Joshua. You mentioned that you can´t share the dumps. Does that mean that I as a developer can´t use WER on Windows Mobile as I am used to under Vista? I mean to login on Microsofts website and download dumps and see which crashes are the most common in my software? Do you have any good proposal of how to get the dump from a user system? It would indeed be nice if I could have the user send me the dump created when (if, only theoretically ofcourse) my software crashes. //Adamcool

  • Anonymous
    April 20, 2009
    Hi, I have found this to be of some interest however it would be good to know how an ISV developer could make more use of the KDMP files that are generated at the time of the 'happy window', I have used CE Dump Viewer a number of times and it has helped me resolve a number of issues however I just feel there is a lot of information that is available in the KDMP files which we could make more use of. Thanks Paul Diston

  • Anonymous
    April 21, 2009
    For developers that want to upload the dump files themselves (like we do on regular Windows), is there any mechanism to do that on Windows Mobile / CE?

  • Anonymous
    April 24, 2009
    Hi Joshua, We are a third part company developing a new generation of touch screen and want to integrate it with windows mobile. Because it supports multi-touch and many other advanced features, we want to contact Microsoft for some detailed information. Could you kindly tell us on who we may contact with on this? Thank you very much in advance! You can send the information to my personal email haifeng.hli@gmail.com Best regards, Haifeng

  • Anonymous
    April 24, 2009
    I just wanted to let everyone know that I am working on getting answers to your comments. I'm in the midst of putting together a good response, but didn't want you to think we weren't paying attention. If you have more questions about Watson or crash reports, please keep them coming. Thanks for the great feedback, Joshua

  • Anonymous
    April 24, 2009
    Hi Joshua, my application has random crashes when another window (for example when phone recieve an sms or a call or an low battery alert) prompts in front of mines. So I start debugging with the device plugged in to pc and i see a lots of prefetch aborts at that point. Right now i dont have the detailed info, but do you have heard something about? Oh!, if i test the same executable on a similar phone the above behaivour doesnt happen. If you can tell my any suggestion i will be very greatfull. Thx.

  • Anonymous
    April 26, 2009
    For anyone asking how to get the access to the dump files: http://www.windowsfordevices.com/articles/AT7568439504.html This article explains how to capture the mini dumps generated by Dr Watson if you have the device.  By default, most CE devices remove the option for process or kernel dumps.  Which is just as well unless the device vendor provides symbold for the OS.   Anyway these mini dumps have proven useful to me in identifying my bugs as well as in demonstrating to the device vendor that the issue lies with their code.

  • Anonymous
    April 27, 2009
    Hi again, I sent some emails and got some answers. For those of you wondering how WER on Windows Mobile differed from a desktop OS, the answer is that it doesn’t. Mobile devices report failures just like desktops using Watson technology. Therefore, you can follow the documentation on http://winqual.microsoft.com for Windows Mobile 6 applications. The accessibility of error reports on Winqual is the same for all ISVs regardless of platform, when a failure comes from a mobile device it's just placed in the Mobile reports page related to your mapped product. Please check out the information on the Winqual site, but in general there are 3 steps to get started.

  1. Register your company using a Verisign certificate (if you're not registered already).
  2. Agree to the Error Reporting terms of use agreement.
  3. Use the "Product Feedback Mapping Tool" to scan a build of the product and upload the generated mapping file so that Winqual can process and expose Watson data related to the mapped product for your company. There’s also a forum on MSDN for questions and discussion of WER for ISVs. http://social.msdn.microsoft.com/Forums/en-US/isvwindowserrors/threads Hopefully this information helps, Joshua