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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc1, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

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

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

              Created:
              Updated:
              Resolved: