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

Text indexes with weights outside the range of representable values of type 'int' can cause undefined behaviour

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.0.0-rc1, 5.1.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • v5.0
    • Hide

      Run this against a UBSAN built mongod.

      (function() {
      "use strict";
       
      const coll = db.weights;
      coll.drop();
       
      assert.commandWorked(coll.insert({x: 1, port: 27017}));
      assert.commandWorked(coll.createIndex({x: 'text'}, {weights: {port: 450000000000}}));
      });
      

       

      Show
      Run this against a UBSAN built mongod. (function() { "use strict" ;   const coll = db.weights; coll.drop();   assert .commandWorked(coll.insert({x: 1 , port: 27017 })); assert .commandWorked(coll.createIndex({x: 'text' }, {weights: {port: 450000000000 }})); });  
    • Execution Team 2021-05-31
    • 43

    Description

      The undefined behaviour sanitizer was trying to create text indexes with weights outside the range of representable values of 'int' here.

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: