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

Inappropriate use of toHex( &number, 4 ) to display value in hex

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.5.2
    • 2.0.7, 2.2.0
    • Logging, Usability
    • Fully Compatible
    • ALL

    Description

      There are some places in the code where we use the toHex() routine to display a number in hexadecimal. This function doesn't do that; it displays a sequence of hexadecimal digits representing the contents of a memory location, in the order that they occur in memory. This means that on little-endian machines (i.e. all machines that MongoDB runs on in shipping branches) all of these values are byte-swapped relative to the actual value represented in hexadecimal.

      Assertion: 10334:BSONObj size: -2 (0xFEFFFFFF) is invalid. Size must be between 0 and 16793600(16MB)

      This should display as:

      Assertion: 10334:BSONObj size: -2 (0xFFFFFFFE) is invalid. Size must be between 0 and 16793600(16MB)

      We should add a function for converting values to hexadecimal display strings and call it instead of toHex() when displaying numeric values.

      Attachments

        Activity

          People

            andrew.emil@10gen.com Andrew Emil (Inactive)
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: