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

Prevent an exception from being thrown when gdb prints a BSONObj with datetimes beyond datetime.MAXYEAR

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      STM 2020-07-27
    • Story Points:
      2

      Description

      The BSON Python package can throw exceptions; the GDB pretty printer allows these exceptions to escape up into gdb/lldb, which can cause them to crash (I'm not sure why).

      Here is an example where I managed to get gdb to print a python stack trace and not crash (this is difficult to achieve):

      (gdb) p oplogBSON         
      $13 = owned BSONObj 340 bytes @ 0x555556a614a8Traceback (most recent call last):
        File "buildscripts/gdb/mongo_printers.py", line 130, in children
          bsondoc = buf.decode(codec_options=options)
        File "/opt/mongodbtoolchain/revisions/e84eb3fd219668197589e62dba14b9914712642d/stow/python3-v3.FFC/lib/python3.7/site-packages/bson/__init__.py", line 1164, in decode
          return _bson_to_dict(self, codec_options)
      bson.errors.InvalidBSON: year 292278994 is out of range
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              richard.samuels Richard Samuels
              Reporter:
              milkie Eric Milkie
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: