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

std::terminate handler must learn to print ASSERT failures

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • Service arch 2020-12-28

      ASSERT statements in unit tests throw TestAssertionFailureException.
      It is deliberately not derived from std::exception or anything else, so that users won't be tempted to catch it. But the terminate handler is special. The process is dying and this is the only chance we have to figure out what the heck happened. We could make a special carve out for the terminate handler to catch and print TestAssertionFailureException.

      Idea:

      We can even do this by making the terminate handler wildcard catch(...) go through a global registry of Lippincott functions to see if any of them can identify the current exception and produce good diagnostics for it. It's perhaps unreasonable to expect that the global terminate handler can have a special case for every kind of exception that might be active. Libraries (fmt, boost, unittest) introduce their own exception types. That's fine as long as they can also add handlers to print diagnostics.

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

              Created:
              Updated:
              Resolved: