![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I wrote a program that uses the berkeley-db 4.4.20. In this program, I creat environment and databases like this: DB_ENV *dbenv = NULL; ret = db_env_create(&dbenv, 0); int mode = 0; unsigned int flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_MPOOL | DB_THREAD; ret = dbenv->open(dbenv, sz_full_dbhome, flags, mode); ret = db_create(&pdb, pdbenv, 0); int mode = 0; unsigned int flags = DB_CREATE | DB_EXCL | DB_THREAD; ret = pdb->open(pdb, NULL, bdb_file, bdb_name, (DBTYPE)ptableinfo->StorageType, flags, mode); Just for test purpose, I terminated the program by pressing keyboard ctrl+c, or writing some illegal code to cause segment fault, double free, etc. Then I found that the environment could be opened successfully, but some databases can't, error message were: unable to allocate memory for mutex; resize mutex region If I restore the __db.001, __db.002, __db.003, __db.004 from backup which were saved after the environment and databases created, all is ok. What's wrong with the envrionment region files? Does the restore work correctly from then on? |
#3
| |||
| |||
|
|
I wrote a program that uses the berkeley-db 4.4.20. In this program, I creat environment and databases like this: ..... Just for test purpose, I terminated the program by pressing keyboard ctrl+c, or writing some illegal code to cause segment fault, double free, etc. |
|
If I restore the __db.001, __db.002, __db.003, __db.004 from backup which were saved after the environment and databases created, all is ok. |
|
What's wrong with the envrionment region files? Does the restore work correctly from then on? |
![]() |
| Thread Tools | |
| Display Modes | |
| |