Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50434

exceptions violating noexcept can be invisible to terminate handler

    • Build
    • ALL
    • 130
    • 4

      When an exception propagates out of a noexcept function, the std::terminate and terminate handler are invoked. During that callback, we check for std::current_exception and try to print a nice diagnostic about what exception was thrown, and we log it. However, we see that we reach the std::terminate only to find that std::current_exception is unexpectedly empty.

      ( BF-17935 and others )

      This has the potential to be a very big support and testing problem, as we'll just have crashes in noexcept functions, with no hint as to the cause. I see a lot of effort in other tickets (e.g. SERVER-36434 ) toward noexcept explicitly to improve diagnostics, because the stack trace of a noexcept violation should better locate the problem. But noexcept will in these cases have the opposite effect, and causes the exception to not be logged at all. All we got in the case of BF-17935 was a partially unwound stack trace from the noexcept function and no logged exception details.

       

      Acceptance Criteria:

      Write crashing test that violates noexcept and compare vs ordinary uncaught exception propagation on all buildvariants.
      Propose a solution or describe rationale for why we can't fix.

            Assignee:
            Unassigned Unassigned
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: