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

"error: offset outside bounds of constant string" compiling src/mongo/bson/bson_obj_test.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      ubuntu@promonarchy-remi:~/mongo$ g++ -c -O2 -Werror -std=c++11 -Ibuild/opt -Isrc src/mongo/bson/bson_obj_test.cpp 
      In file included from src/mongo/db/jsobj.h:49:0,
                       from src/mongo/bson/bson_obj_test.cpp:28:
      src/mongo/bson/bsonelement.h: In member function ‘virtual void {anonymous}::UnitTest__BSONObj__getFields::_doTest()’:
      src/mongo/bson/bsonelement.h:236:23: error: offset outside bounds of constant string [-Werror]
               return data + 1;
                             ^
      cc1plus: all warnings being treated as errors
      

      Show
      ubuntu@promonarchy-remi:~/mongo$ g++ -c -O2 -Werror -std=c++11 -Ibuild/opt -Isrc src/mongo/bson/bson_obj_test.cpp In file included from src/mongo/db/jsobj.h:49:0, from src/mongo/bson/bson_obj_test.cpp:28: src/mongo/bson/bsonelement.h: In member function ‘virtual void {anonymous}::UnitTest__BSONObj__getFields::_doTest()’: src/mongo/bson/bsonelement.h:236:23: error: offset outside bounds of constant string [-Werror] return data + 1; ^ cc1plus: all warnings being treated as errors
    • Sprint:
      Platforms 13 (04/22/16)

      Description

      This is a bit strange and it might be a compiler bug. but if you try to build mongodb on Ubuntu Xenial you get this problem. The smallest version of the code I've managed to find is http://paste.ubuntu.com/15573440/. I haven't tried using gcc tip yet, that's probably one of the next things to try.

      It happens with 3.2 and git tip.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jonathan.reams Jonathan Reams
              Reporter:
              mwhudson Michael Hudson-Doyle
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: