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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • STM 2020-07-27
    • 2

      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
      

            Assignee:
            richard.samuels@mongodb.com Richard Samuels (Inactive)
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: