Open Environment error : Resource temporarily unavailable
569973Sep 4 2007 — edited Sep 4 2007Hi,
I use Berkeley DB 4.5.2 in a system with Intel PXA255, 64MB memory, 512MB USB disk. The system is Linux 2.4.18, compiler is arm-linux-gcc 2.95.3. I put database files on the USB disk (because the file size is more than 72MB), and the disk still got 70% free space (so I don't think the problem is caused by the disk space).
The same program is run pretty well on PC, Intel P4 3.0, 512MB memory, Red hat Linux 4.2 Enterprise (Linux 2.6.9-22), compiler is gcc 4.3.3.
But it could not even open the Environment on the board. One program shows error message:
Environment open failed: Resource temporarily unavailable.
The other program shows error message:
unhandled page fault at pc=0x00019808, lr=0x000197f4 (bad address=0x000000dc, code 0)
pc : [<00019808>] lr : [<000197f4>] Not tainted
sp : bffff528 ip : bffff700 fp : bffff804
r10: 402d62fc r9 : 402d5c88 r8 : 0001ee90
r7 : 00000001 r6 : 00008a24 r5 : 4001e724 r4 : bffffce4
r3 : 00000000 r2 : 00029cf0 r1 : bffff71c r0 : bffff700
Flags: nzcv IRQs on FIQs on Mode USER_32 Segment user
Control: 397F Table: A3DF8000 DAC: 00000015
Segmentation fault
They are using the same code:
#define __DEBUG 1
...
ret = db_env_create(&VitalEnv, 0);
if (0 != ret)
{
#if __DEBUG
fprintf(stderr, "Error in creating environment handle: %s.\n", db_strerror(ret));
#endif
return ret
}/*endif*/
env_flags = DB_CREATE | DB_INIT_MPOOL;
ret = VitalEnv->open(VitalEnv, "./Data", env_flags, 0);
if (0 != ret)
{
#if __DEBUG
fprintf(stderr, "Environmet open failed: %s.\n", db_strerror(ret));
#endif
return ret;
}/*endif*/
...
The only difference is that I put these codes in a function called OpenDB() for the second program, and just put these codes in main() for the first program.
And both of them could not open environment.
I have put the arm version libdb-4.5.so on the USB disk. Everything I did but the problem is still there.