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

Investigate inconsistent behaviour in mozilla::ConvertUtf16toUtf8Partial

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      During the MozJS upgrade to ESR115.19, we discovered that some test suites had not been run during the upgrade to ESR91.3, when certain functionality was migrated from Rust to C++. 

      On our spidermonkey fork , running the jsapi-tests fails with a single failure "test_DeflateStringToUTF8Buffer". The failing test is found here

      We get this error because the rust implementation of the utf16->utf8 conversion does not write any extra replacement characters when the converted string does not fit in the destination buffer. However, it looks like in our implementation , we add replacement characters for this scenario. 

      As part of this ticket, take a closer look at the implementation we have provided, and investigate whether or not we are integrating the call to ICU to convert the utf16 string correctly. We should determine if the corrective code we provide is required, and whether or not we should ensure we provide a matching implementation to that provided by rust.

      A preliminary look at the usage of this function led to the conclusion that no out of memory bounds accesses would occur as a result of this issue.

            Assignee:
            Unassigned Unassigned
            Reporter:
            santiago.roche@mongodb.com Santiago Roche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None