Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8275008

gtest build failure due to stringop-overflow warning with gcc11

XMLWordPrintable

    • b19

        * For target hotspot_variant-server_libjvm_gtest_objs_test_guardedMemory.o:
        In file included from /usr/include/string.h:495,
                         from /home/jdk/src/hotspot/share/utilities/globalDefinitions_gcc.hpp:35,
                         from /home/jdk/src/hotspot/share/utilities/globalDefinitions.hpp:35,
                         from /home/jdk/src/hotspot/share/memory/allocation.hpp:29,
                         from /home/jdk/test/hotspot/gtest/memory/test_guardedMemory.cpp:25:
        In function 'void* memset(void*, int, size_t)',
            inlined from 'virtual void GuardedMemory_buffer_overrun_tail_Test::TestBody()' at /home/jdk/test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11:
        /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:33: error: 'void* __builtin_memset(void*, int, long unsigned int)' writing between 2 and 262144 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
           71 | return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
              | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1plus: all warnings being treated as errors

              jiefu Jie Fu
              jiefu Jie Fu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: