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

C++ exceptions is a risky business..

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.1.0
    • 2.1.0
    • couchbase-bucket
    • Security Level: Public
    • None
    • SmartOS with gcc 4.7

    Description

      We're using C++ exceptions to track problems during reading the content of a file (missing file, incomplete reads etc). The problem is that exceptions in C++ is a really shaky feature. Currently we're catching:

      const std::ifstream::failure &e

      but this fails on SmartOS with gcc 4.7, instead it is able to catch:

      std::ifstream::failure e

      (which is also what's used in the example in http://www.cplusplus.com/reference/ios/ios/exceptions/ )

      Given that the above code is already used in our product and verified to work on windows, linux and macos I figured it would be safer to just add a "catch-all" clause that catchs all other errors.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            trond Trond Norbye
            trond Trond Norbye
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty