Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1423

libcouchbase compilation issue using gcc 11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.2.0
    • 3.0.6
    • None
    • None
    • 1

    Description

      As part of Amadeus delivery of mdw with new toolchain (gcc 11), we encountered some issues with libcouchbase compilation.

      In file included from /remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/contrib/gtest-1.8.1/src/gtest-all.cc:42:
      /remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/contrib/gtest-1.8.1/src/gtest-death-test.cc: In function 'bool testing::internal::StackGrowsDown()':
      /remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/contrib/gtest-1.8.1/src/gtest-death-test.cc:1224:24: error: 'dummy' may be used uninitialized [-Werror=maybe-uninitialized]
       1224 |   StackLowerThanAddress(&dummy, &result);
            |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      /remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/contrib/gtest-1.8.1/src/gtest-death-test.cc:1214:13: note: by argument 1 of type 'const void*' to 'void testing::internal::StackLowerThanAddress(const void*, bool*)' declared here
       1214 | static void StackLowerThanAddress(const void* ptr, bool* result) {
            |             ^~~~~~~~~~~~~~~~~~~~~
      /remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/contrib/gtest-1.8.1/src/gtest-death-test.cc:1222:7: note: 'dummy' declared here
       1222 |   int dummy;
            |       ^~~~~
      cc1plus: all warnings being treated as errors
      tests/gtest/CMakeFiles/gtest.dir/build.make:78: recipe for target 'tests/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o' failed
      make[2]: *** [tests/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
      make[2]: Leaving directory '/remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/_build_shared'
      CMakeFiles/Makefile2:1386: recipe for target 'tests/gtest/CMakeFiles/gtest.dir/all' failed
      make[1]: *** [tests/gtest/CMakeFiles/gtest.dir/all] Error 2
      make[1]: Leaving directory '/remote/users/adeltour/git/ext-couchbase-libcouchbase/BUILD/libcouchbase-3.0.6/_build_shared'
      Makefile:168: recipe for target 'all' failed
      make: *** [all] Error 2
      
      

      A fix has normally been done in gtest 1.11, cf. this commit https://github.com/google/googletest/commit/4679637f1c9d5a0728bdc347a531737fad0b1ca3

      Could you patch or upgrade with last version of gtest in order to remove a patch done on our side recently:

      --- contrib/gtest-1.8.1/src/gtest-death-test.cc 2021-06-30 13:29:29.833866000 +0000
      +++ contrib/gtest-1.8.1/src/gtest-death-test.cc     2021-06-30 13:30:04.989408000 +0000
      @@ -1219,7 +1219,7 @@
       // Make sure AddressSanitizer does not tamper with the stack here.
       GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
       static bool StackGrowsDown() {
      -  int dummy;
      +  int dummy = 0;
         bool result;
         StackLowerThanAddress(&dummy, &result);
         return result;
      

      Attachments

        For Gerrit Dashboard: CCBC-1423
        # Subject Branch Project Status CR V

        Activity

          People

            avsej Sergey Avseyev
            Alexis Deltour Alexis Deltour
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty