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

mongodbtoolchain/v3 stdlib unsafe against self-moves

    • Server Development Platform
    • Fully Compatible
    • ALL
    • 0

      Capturing action recommendations from BF investigation.
      A LOT of technical details are included in BF-27032 for this.

      allison.easton@mongodb.com summarized well here:

      std::shuffle has a bug in which it will sometimes try to swap an object with itself. This results in a self move of the object. Some stl types (including vector) had bugs relating to self move operations and debug assertions that they cannot be move assigned to themselves. These problems are fixed in the v4 toolchain due to fixes in libstdc+, but these fixes are not present in the v3 toolchain. We need to upgrade libstdc+ in the v3 toolchain so that these containers have the fixes for self moves.

      billy.donahue@mongodb.com and matt.diener@mongodb.com confirmed this assessment after further investigation into whether this could be confined to tests. Unfortunately it is not.

      The toolchain v3 standard library would need to be patched or abandoned to get us past this.

      It's unknown at this time what the impact of leaving v3 toolchain unpatched would be. We'd have to study the faulty move operations and write tests against them. My guess is that this would be at least as much work as patching the toolchain, likely more. In the meantime we're looking at undefined behavior or worse and we should not let that continue.

      It's also possible the answer here is to have C++ engineers study the self-move bugs in the standard library implementations more closely.

            daniel.moody@mongodb.com Daniel Moody
            billy.donahue@mongodb.com Billy Donahue
            0 Vote for this issue
            5 Start watching this issue