Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
4.0.0
-
Security Level: Public
-
None
-
Untriaged
-
Unknown
-
ForestDB: Oct 26 - Nov 13
Description
I'm hitting an assertion-failure crash in fdb_check_file_reopen, in the following code:
fs = _fdb_close(handle);
fdb_assert(fs == FDB_RESULT_SUCCESS, fs, handle);
fs = _fdb_open(handle, new_filename, FDB_AFILENAME, &config);
fdb_assert(fs == FDB_RESULT_SUCCESS, fs, handle); // SIGABORT!
(The underlying problem is that the file has been (mysteriously) deleted, which is why the _fdb_open call failed.)
But the issue I'm reporting is that there should not be assertions that can trigger based on the results of I/O. Assertions should check "impossible" failures, and I/O errors are entirely possible.
In this case, fdb_check_file_reopen already returns an fdb_status, so the error from _fdb_open should just be returned from the function.
(Note: I'm building forestdb from commit def42ac, dated 8/20/15.)