I get a strange error browsing thru a db with DmQueryRecord
First I got it when reading record # 127 (in a 330 record db).
When I close the db and reopen it again (after every 100 records), I can
browse thru the whole database, but get the same error when reading the same
database a second time (somewhere between 0 and 100 records).
The error message from Palm OS Emulator is:
Programx just read from memory location 0x048E00CA, causing a bus error.
The line of code where the error appears:
recordH = DmQueryRecord( gItemDB, i);
recordH is MemHandle, i is UInt16
The loop also contains
record = (PackedItem *) MemHandleLock(recordH);
// extract data from record
MemHandleUnlock( recordH);
The index i seems to have the expected value when calling DmQueryRecord
The log file with the last 2 calls included looks like this:
10042.062: --- System Call 0xA05B: |-|-|-|-DmQueryRecord.
10042.062: --- System Call 0xA023: |-|-|-|-|MemLocalIDToGlobal.
10042.062: --- System Call 0xA33C: |-|-|-|-|-|SysGetAppInfo.
10042.062: --- System Call 0xA021: |-|-|-|-MemHandleLock.
10042.062: --- System Call 0xA03C: |-|-|-|-|MemSemaphoreReserve.
10042.062: --- System Call 0xA24A: |-|-|-|-|-HwrEnableDataWrites.
10042.062: --- System Call 0xA03D: |-|-|-|-|MemSemaphoreRelease.
10042.062: --- System Call 0xA24B: |-|-|-|-|-HwrDisableDataWrites.
10042.062: --- System Call 0xA022: |-|-|-|-MemHandleUnlock.
10042.062: --- System Call 0xA03C: |-|-|-|-|MemSemaphoreReserve.
10042.062: --- System Call 0xA24A: |-|-|-|-|-HwrEnableDataWrites.
10042.062: --- System Call 0xA03D: |-|-|-|-|MemSemaphoreRelease.
10042.062: --- System Call 0xA24B: |-|-|-|-|-HwrDisableDataWrites.
10042.062: --- System Call 0xA05B: |-|-|-|-DmQueryRecord.
10042.062: --- System Call 0xA023: |-|-|-|-|MemLocalIDToGlobal.
10042.062: --- System Call 0xA33C: |-|-|-|-|-|SysGetAppInfo.
10042.140: === ERROR:
****************************************************************************
****
10042.140: === ERROR: ProgramX (1.0) just read from memory location
0x048E00CA, causing a bus error.
A "bus error" means that the application accessed a memory location that is
not in RAM or ROM, nor corresponds to a memory-mapped hardware register.
10042.140: === ERROR:
****************************************************************************
****
Any ideas?
What can I do to investigate this further?
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/