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

[SBE] Fix bool/int32_t issue on big-endian systems

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
    • Fully Compatible
    • ALL
    • Query 2020-09-07, Query 2020-09-21, Query 2020-10-05, Query 2020-10-19
    • 0

      In various places in the codebase, we store bool's and int32_t's inside sbe::value::Value's and retrieve bool's / int32_t's from sbe::value::Value's in different ways, and this is causing problems on big endian systems like s390x. For an example of where we've been bitten by this, see https://jira.mongodb.org/browse/BF-18537 .

      First, we need to decide on the encoding we want to use when storing a bool or an int32_t into an sbe::value::Value, both for little-endian systems and for big-endian systems. Based on that decision, we can then identify which places in the code are storing/retrieving bool's and int32_t's correctly and which places in the code are storing/retrieving bool's and int32_t's incorrectly. Finally, we can identify the pitfalls that exist where developers might accidentally use the wrong ways to store/retrieve bool's and int32_t's, and what we can do to make it harder for developers to accidentally make these mistakes.

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            andrew.paroski@mongodb.com Drew Paroski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: