AttnGrab SMS crash bug

Despite reports from users on a crash when receiving SMSes, I could not get this to happen to me and a review of the code didn’t reveal any problems.

However a few days ago I got the exact symptoms that one user had complained about. That is, my phone beeped twice then rebooted and the cause of this reboot was an SMS being received. At first I thought perhaps the problem was due to some difference between Australian and US SMSes (the SMS that crashed my phone came from facebook) but by chance, I noticed something odd about my AttnGrab settings that led me to the actual problem.

The problem I noticed is that my seconds value was set to 0 instead of 300. Due to a bug in the SetAlarm code, this meant that AttnGrab would set an alarm for the current time, causing an alert loop. When I used atgdebug to simulate an alert, the phone did not crash but then AlarmTriggered() is run while another app has the stack (it’s a pointer handler) so perhaps something about the state when an SMS is received didn’t appreciate this alert loop.

So the first thing I fixed was to ensure that the alarm is only ever set for the future or cleared.

What puzzled me though was how my settings got changed in the first place. I stumbled on it almost by accident. The Ringer State checkbox does some processing when you click it. The first thing it does is save the state. However, when this happens the seconds field is emptied (but not redrawn). The field was supposed to be re-initialised but this didn’t happen in certain cases. In these cases, pressing Done would save 0 for seconds. Clicking the field is what gave me the clue because when I did that it cleared itself. This has been fixed now so your seconds value should not get eaten by the Ringer State checkbox anymore.

If you’ve experienced crashes with AttnGrab please try the new version at http://ramsay.webhop.org/attngrab.

Update 10 June 2009

It seems this has not fixed the issue. There seems to be something fundamentally different going on with Centro devices because I’m just not seeing the reported symptoms. I just love coding blind… :(

About a1291762

I'm a software developer by trade and a musician by heart. I'm a techno-gadget freak and I dabble in photography. I'm married with two kids, we drive Toyotas and use Macintoshes.
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>