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

BSON errors should log memory context

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2019-10-21, Execution Team 2019-11-04
    • 19

      If a corrupt BSON document is encountered, the error messages generated are usually unhelpful. These messages are particularly unhelpful because an error parsing or constructing a BSON object often results in the destruction of the object before the exception is caught, nullifying any attempts to examine the memory in a core dump.

      For example, if a BSONElement has an invalid type an error message like the following is printed:

      Assertion: Location10320: BSONElement: bad type 119 src/mongo/bson/bsonelement.cpp 599
      

      This is also unhelpful because the file and line number reported will always be the same for this error, regardless of the location in the code.

      We should consider dumping the following information in the face of these types of errors:

      • Print the starting address and raw memory of the corrupt BSON object
      • Print a stack trace to locate the code that encountered the error

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: