Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-16215

Don't make assertions about file I/O results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • 4.0.0
    • forestdb
    • 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.)

      Attachments

        For Gerrit Dashboard: MB-16215
        # Subject Branch Project Status CR V

        Activity

          People

            chiyoung Chiyoung Seo (Inactive)
            jens Jens Alfke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty