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

DatabaseName pretty printer causes gdb crash

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Security
    • Fully Compatible
    • ALL
    • v8.0
    • Security 2024-06-24
    • 200

      Reproduction steps with the core dump from this BFG:

      (gdb) thread apply 40 bt 27

      gdb will succeed

      (gdb) thread apply 40 bt 28

      Recursive internal problem.

       

      (gdb) disable pretty-printer global mongo;DatabaseName

      1 printer disabled

      281 of 282 printers enabled

      (gdb) thread apply 40 bt 28

      gdb will succeed

       

       

      (gdb) f 27
      (gdb) p dbName
      $6 = (const mongo::DatabaseName &) @0x60002d1e0000: {
        _data =

      {     _data = 0x55bbd34e7fd5 <__tsan_atomic32_store()+69> "H\215\r\004Z\215",     _length = 4611686018427387904,     _footer = 140379693904630   }

      }

      The value of dbName is wrong and our pretty printers try to allocate 4611686018427387904 bytes to read it

       

      (gdb) python gdb.selected_inferior().read_memory(0x55bbd34e7fd5, 4611686018427387904)
      /data/mci/0d2d927a2c6c6202f906eb70ddfa4799/toolchain-builder/tmp/build-gdb-v4.sh-n3T/src/gdb-12.1/gdb/utils.c:712: internal-error: virtual memory exhausted: can't allocate 4611686018427387904 bytes.
      A problem internal to GDB has been detected,
      further debugging may prove unreliable.

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            trevor.guidry@mongodb.com Trevor Guidry
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: