4

I've been working on this problem on and off for about a month. I don't expect anybody to be able to give me a definitive answer. I'm just completely out of ideas at this point and could use anything.

The problem is that my app crashes on only some models of phones. I have an HTC surround and it runs fine. It has also been tested on a Samsung Focus and it works there to. It crashes pretty consistently on a HTC mozart. There are other phones it crashes on but I don't know what models they are. I don't have access to an HTC mozart so debugging has been very difficult.

I'm handling the application UnhandledException event and I have try catch around every background thread. The error handling code never runs.

What I know:
Sometimes it freezes and requires a press of the power button. At least once it required the battery taken out. Most of the time it freezes and then crashes.
Most of the time it crashes on the main menu, before everything displays.
It's not 100% consistent. Sometimes it works for a little bit, but never very long.
It's not because it's out of memory. Most of the time it crashes while using less then 8MB.
When all the exception handling didn't work I added debug logging. This slows things way down but at the same time the issue goes away.

These symptoms make it sound like a deadlock to me. Although I have gone over the code and there is no thread ever entering more then 1 lock at a time.

Any ideas on how I should track this down would be appreciated.

Edit: This is a WP7 version of my game. I've just been able to confirm with a volunteer with an HTC mozart that the simplest conversion of the code meant for to run on the web will crash on the phone. That's code has no networking, isolated storage, or sound.

I also should have mentioned that this has passed certification and was in the marketplace for a few days until I took it down because it got bad reviews (because it was unplayable for some people)

liserdarts
  • 260
  • 3
  • 14
  • Can you write the exception details and stack trace to a log file and access it on application relaunch to try to work out what the problem is? – Derek Lakin Feb 28 '11 at 15:58
  • I don't think I'm even catching an exception because the code I have is supposed to show a confirm dialog that asks to email it to me. And that never happens. I suppose it's worth a try though. – liserdarts Feb 28 '11 at 16:07
  • Did you test it on more than one Mozart? Maybe that one particular model has some corrupted memory and ur being unlucky? – Marcom Feb 28 '11 at 15:56
  • I've already tried releasing this to the marketplace and all the feedback I got reported it crashing. I took it down after 1 day to fix it. One of the comments specifically mentioned they were using a Mozart. – liserdarts Feb 28 '11 at 16:10
  • Are you using complex controls like WebBrowser or Bing Maps? – Andréas Saudemont Mar 03 '11 at 22:03
  • I am not using anything very fancy. Mostly images, polygons, and StackPanels and other lists. No maps, WebBrowsers, Pivots, or panorama. – liserdarts Mar 03 '11 at 22:07

4 Answers4

1

If the devices are locking up, then my suspicions would be to look at the areas where you are closest to the driver level/hardware, which (looking at your game) are:

  • the display
  • the sound

It could also be just about due to processing/CPU activity - but generally "User level" code shouldn't be able to lock up your phone - that functionality is reserved for kernel software.

The only way of really testing this is to get hold of a device where this "reliably crashes" (e.g. a Mozart) and to go through the process of disabling bits of functionality one by one.

If this is a Silverlight app, then I'd expect Microsoft to want to help - I'd contact them via AppHub and via their local Evangelist team - they'll have the means and the motivation to assist you.

I'm happy to assist on testing on a developer-unlocked HTC Trophy if that helps!

Stuart
  • 66,722
  • 7
  • 114
  • 165
  • Just rereading this... definitely check the synchronisation locking around any access to XNA - e.g. sound effects. – Stuart Feb 28 '11 at 19:09
  • I can rule out the sound because I used to use media elements for sound, but now I use XNA. The problem has been around before and after that change. I'll post this on the AppHub once I find out what it is. (Provided it's not my fault) I would like to know what happens on an HTC Trophy. How can I contact you? – liserdarts Feb 28 '11 at 21:09
  • me at slodge dot com - if you email me a XAP then I'll install it early tomorrow UK time – Stuart Feb 28 '11 at 21:26
0

The only thing I can think of that's unique to the Mozart is that it has an 8MP camera and all others have a 5MP camera.

Are you using a CameraCaptureTask and expecting the returned image to be a certain size?

Other than that, what does the app do? what services and device functionality are you using?

Do you have any network access running on a background thread?

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • I'm not using the camera. This is a WP7 version of my [game](http://www.liserdartsgames.com/SnowSpill.aspx) I've have hosted on the web for a while now. It doesn't use anything specific to windows phones, it was originally meant just for the web. I do have network access running on a background thread. I'm using System.Net.HttpWebRequest to use Google analytics. – liserdarts Feb 28 '11 at 17:29
0

I had roughly the same problem when developing my WP7 app. As far as I can tell it isn't as much model bound as it is device bound. In fact I had my app deployed to 15+ Trophy's (my company gave all their employees one of those) and it would repeatedly crash on some of them all having the same firmware. Some of the feedback I got through the reviews seems to indicate that it also happens in the wild.

In my case the crash occurs primarily (only?) when the app is launched. There does seem to be a strong correlation between internet connectivity and crashing in that I can 'recreate' the crash by putting my phone in flight mode, unplugging the network cable from my computer and then deploying the app. In that case too it immediately crashes and no event or break point is ever raised.

My gut feeling tell me it might have something to do with the map control as that does tend to respond funky to poor connectivity when the application is loading (like displaying an error message that the card cant be loaded while simultaneously displaying the map) Does your app also use the Map Control (in combination with a Pivot control perhaps?)

0

Some of the devices have issues where you need set things to "content" instead of "embedded resource" in your project.

Although i've more heard about that issue related to app startup time, as on some devices (HD7?) the load of the app was taking enough time that the app was never allowed to start, the OS thought it was taking too long and killed it.

John Gardner
  • 24,225
  • 5
  • 58
  • 76