ftbfs with gcc 6

Bug #1610767 reported by Michael Hudson-Doyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-mongodb3.2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The immediate problem is -Werror=nonnull-compare:

g++ -o build/opt/mongo/db/fts/fts_spec.o -c -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wnon-virtual-dtor -Woverloaded-virtual -Wno-maybe-uninitialized -std=c++11 -fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -O2 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-unused-variable -Wno-maybe-uninitialized -Wno-missing-braces -fno-builtin-memcmp -DNDEBUG -DBOOST_THREAD_VERSION=4 -DBOOST_THREAD_DONT_PROVIDE_VARIADIC_THREAD -DBOOST_SYSTEM_NO_DEPRECATED -Isrc/third_party/libstemmer_c/include -Isrc/third_party/s2 -Ibuild/opt -Isrc src/mongo/db/fts/fts_spec.cpp
In file included from src/mongo/platform/compiler.h:132:0,
                 from src/mongo/util/invariant.h:30,
                 from src/mongo/base/string_data.h:39,
                 from build/opt/mongo/base/error_codes.h:31,
                 from src/mongo/base/status.h:34,
                 from src/mongo/client/dbclient.cpp:36:
src/mongo/client/dbclientcursor.h: In member function 'void mongo::DBClientCursor::_assertIfNull() const':
src/mongo/util/assert_util.h:233:28: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]
         if (MONGO_unlikely(!(expr))) { \
                            ^~~~~~~
src/mongo/platform/compiler_gcc.h:66:80: note: in definition of macro 'MONGO_unlikely'
 #define MONGO_unlikely(x) static_cast<bool>(__builtin_expect(static_cast<bool>(x), 0))
                                                                                ^
src/mongo/util/assert_util.h:319:17: note: in expansion of macro 'MONGO_uassert'
 #define uassert MONGO_uassert
                 ^~~~~~~~~~~~~
src/mongo/client/dbclientcursor.h:295:9: note: in expansion of macro 'uassert'
         uassert(13348, "connection died", this);
         ^~~~~~~

Tags: ftbfs
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

That appears to be the only new warning, so I guess we should add -Wno-error=nonnull-compare to disable-warnings.patch (this is https://jira.mongodb.org/browse/SERVER-25385).

The next failure is this:

In file included from src/mongo/base/parse_number_test.cpp:38:0:
src/mongo/base/parse_number_test.cpp:297:49: error: exponent has no digits
     ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);
                                                 ^
src/mongo/unittest/unittest.h:105:93: note: in definition of macro '_ASSERT_COMPARISON'
             ::mongo::unittest::ComparisonAssertion_##COMPARISON(__FILE__, __LINE__, #a, #b, a, b)) \
                                                                                             ^
src/mongo/unittest/unittest.h:84:29: note: in expansion of macro 'ASSERT_EQ'
 #define ASSERT_EQUALS(a, b) ASSERT_EQ(a, b)
                             ^~~~~~~~~
src/mongo/base/parse_number_test.cpp:44:9: note: in expansion of macro 'ASSERT_EQUALS'
         ASSERT_EQUALS(static_cast<TYPE>(EXPECTED_VALUE), v); \
         ^~~~~~~~~~~~~
src/mongo/base/parse_number_test.cpp:297:5: note: in expansion of macro 'ASSERT_PARSES'
     ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10);
     ^~~~~~~~~~~~~

which I think could be fixed by backporting the SConstruct part of

https://github.com/mongodb/mongo/commit/a0c60da29313848e6b4207a8d301d2facdf3fd7c

and adding --cxx-std=14 to COMMON_OPTIONS.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I was wrong about that last bit.

tags: added: ftbfs
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Ah those constants are only a C++17 feature, so I'm going to try building with -std=c++17. But probably a better fix is just to comment that single line out of the test file.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package juju-mongodb3.2 - 3.2.8-0ubuntu3

---------------
juju-mongodb3.2 (3.2.8-0ubuntu3) yakkety; urgency=medium

  * Fix ftbfs: (LP: #1610767):
    - Add d/patches/gcc6-ftbfs.patch to fix 2 warnings and 1 error.
    - Add d/patches/SERVER-16221-SERVER-23712-Aggregation-unit-tests-sho.patch,
      backported from master.

 -- Michael Hudson-Doyle <email address hidden> Mon, 08 Aug 2016 13:41:08 +1200

Changed in juju-mongodb3.2 (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.