tkrzw: "too small file" error when database was not closed
I’m using the C bridge, in combination with HashDBM, version 0.9.38
.
If tkrzw_dbm_close
was not called for some reason, and program is terminated, next time the database is opened with tkrzw_dbm_open
, the result is NULL
, and tkrzw_last_status_message
returns “too small file”.
The only way I found to restore the database is with
$ tkrzw_dbm_util rebuild <file>
($ tkrzw_dbm_util restore <file>
does not work for that case)
I know that tkrzw_dbm_close
always should be called. But in practice, it can always happen that it was not called. For example when an unexpected system reboot or program fault occurs.
Is there any way to prevent issues while opening a previously unclosed database?
For example an auto restore in tkrzw_dbm_open
?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (12 by maintainers)
I released 0.9.41 where this issue is HIDDEN (not fixed) by another logic to omit the restore operation. To reproduce this issue, the following patch is useful.
On my Intel Macbook, this issue is not reproduced even if I applied the patch. I’ll investigate this issue further when I obtained M1 Macbook.