Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-848

Probable readv crash when creating non-contiguous GridFS chunks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • 1.3.0-rc0
    • GridFS
    • Fully Compatible

    Description

      One can seek past the end of a GridFS file and proceed to write:

      mongoc_gridfs_file_seek (file, 1024 * 32, SEEK_END)
      mongoc_gridfs_file_writev (file, iov, iovcnt, timeout_msec);
      

      However, performing a mongoc_gridfs_file_readv() in the "gap space" will likely end in a crash. The C Driver needs to decide how it wants to handle this, consistent with the GridFS spec. Perhaps a reasonable approach is to:

      1. Seek past the end of the file.
      2. On performing any I/O operation, fill in the missing chunks with zero bytes, similar to the behavior of fseek(2) and writev(2).

      Attachments

        Issue Links

          Activity

            People

              kyle.suarez@mongodb.com Kyle Suarez
              kyle.suarez@mongodb.com Kyle Suarez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: