Re: RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-11 Thread Jie Fu
On Mon, 11 Oct 2021 02:35:20 GMT, David Holmes  wrote:

>> Hi all,
>> 
>> gtest build fails due to stringop-overflow warning with gcc11.
>> 
>> This is because gcc11 seems to be smart enough to detect the following 
>> stringop-overflow at test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11.
>> 
>> * 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:
>
> Okay. Seems a bit heavy handed to disable across all gtests but okay.
> 
> Thanks,
> David

Thanks @dholmes-ora and @magicus .

-

PR: https://git.openjdk.java.net/jdk/pull/5881


Re: RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-11 Thread Magnus Ihse Bursie
On Sun, 10 Oct 2021 13:05:40 GMT, Jie Fu  wrote:

> Hi all,
> 
> gtest build fails due to stringop-overflow warning with gcc11.
> 
> This is because gcc11 seems to be smart enough to detect the following 
> stringop-overflow at test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11.
> 
> * 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:

Marked as reviewed by ihse (Reviewer).

We do not currently have a way to disable warnings for individual files in a 
library. The only other way to disable warnings for a specific place is to use 
`#pragma`.

Looks good.

-

PR: https://git.openjdk.java.net/jdk/pull/5881


Re: RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-10 Thread David Holmes
On Sun, 10 Oct 2021 13:05:40 GMT, Jie Fu  wrote:

> Hi all,
> 
> gtest build fails due to stringop-overflow warning with gcc11.
> 
> This is because gcc11 seems to be smart enough to detect the following 
> stringop-overflow at test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11.
> 
> * 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:

Okay. Seems a bit heavy handed to disable across all gtests but okay.

Thanks,
David

-

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5881


Re: RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-10 Thread Jie Fu
On Mon, 11 Oct 2021 00:47:38 GMT, David Holmes  wrote:

> Hi Jie,
> 
> Can we not just disable the warning in this specific test?
> 
> Thanks, David

Thanks @dholmes-ora for your review.

According to this comment [1], gtest source code warnings are disabled in build 
script.
Maybe, it would be better to also follow that style here.

What do you think?
Thanks. 

[1] 
https://github.com/openjdk/jdk/blob/master/make/hotspot/lib/CompileGtest.gmk#L84

-

PR: https://git.openjdk.java.net/jdk/pull/5881


Re: RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-10 Thread David Holmes
On Sun, 10 Oct 2021 13:05:40 GMT, Jie Fu  wrote:

> Hi all,
> 
> gtest build fails due to stringop-overflow warning with gcc11.
> 
> This is because gcc11 seems to be smart enough to detect the following 
> stringop-overflow at test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11.
> 
> * 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:

Hi Jie,

Can we not just disable the warning in this specific test?

Thanks,
David

-

PR: https://git.openjdk.java.net/jdk/pull/5881


RFR: 8275008: gtest build failure due to stringop-overflow warning with gcc11

2021-10-10 Thread Jie Fu
Hi all,

gtest build fails due to stringop-overflow warning with gcc11.

This is because gcc11 seems to be smart enough to detect the following 
stringop-overflow at test/hotspot/gtest/memory/test_guardedMemory.cpp:125:11.

* 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:

-

Commit messages:
 - Update copyright year
 - 8275008: gtest build failure due to stringop-overflow warning with gcc11

Changes: https://git.openjdk.java.net/jdk/pull/5881/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5881&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8275008
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5881.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5881/head:pull/5881

PR: https://git.openjdk.java.net/jdk/pull/5881