Ben Combee wrote:
At 05:54 AM 4/21/2005, you wrote:


This is a bug in DmDetachRecord in Palm OS 5.4.7 which happens if you try to detach a record with a NULL data chunk. These can be created by calls to DmAttachRecord with a NULL value for the data handle. The workaround is to make sure your record does not contain NULL before deleting. I'm not sure how this affects records that have been deleted using DmDeleteRecord. DmRemoveRecord calls DmDetachRecord, so it would be affected by this too.


You might want to write a small test app that scans your DB using DmRecordInfo and reports about any NULL records. If I can characterize this problem better, I'll make a post on my weblog.

-- Ben Combee, Senior Software Engineer, palmOne, Inc.
   "Combee on Palm OS" weblog: http://palmos.combee.net/
   Developer Forum Archives:   http://news.palmos.com/read/all_forums/



Thanks for the reply Ben. It helped understand some of the other issues we have been working on.


I am still not sure quite how we have triggered this bug tho.

The exact sequance of events that seams to cause this are:-

1) Deleteion of e-mail PC side
2) Hotsync, causing the corisponding deletion on the device.
3) During the cleanup phase the device code calls DmDeleteRecord to delete an index record that is nolonger valid (This record was just a normal record with 8 bytes of data, so this should not cause this error)


At this point everything seams to be working fine.

4) A second hotsync (which should make no changes)
4a) Crash after calling SyncPurgeDeletedRecs


The only deleted record at this time is the index record deleted in 3.


I have just done some more testing, and if I use DmArchiveRecord in 3, the device crashes during the cleanup phase, If I use DmRemoveRecord, everything works with no crashes.


--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to