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

Illegal math operations computing in JS V8

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.1.0
    • Component/s: JavaScript
    • Environment:
      FC15 x86-64
    • Linux

      For Intensives findAndModify operations which use a service call $inc in some cases there is a loss 0.00000000000000005, 0.00000000000000001, 0.66666666666666667 and 0.33333333333333333. This effect is mistery! No memory leak detected, memory and CPU working correctly. Test also working on other OS.

      example for node.js (db already connected for database)

      begin:
      db.collection("test").save(

      {a: 1, test:10000000}

      );

      test:
      for(var i=0;i<1000000;i++) {
      db.collection("test").findAndModify(

      {a:1}

      ,[], {$inc: {test: -0.01}},

      {new:true}

      ,function(err,v)

      {if(v!=null)console.log(v);}

      );
      }

      After approximately 10 to 10000 operations - there is a loss on the error
      This is math error, maybe in V8 engine
      P.S. SpiderMonkey engine don't have this bug - I'm already test it.

            Assignee:
            antoine Antoine Girbal
            Reporter:
            qxfusion Vitaly qxFusion
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: