-
Bug
-
Resolution: Fixed
-
P3
-
8, 11
-
b01
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8247317 | 11.0.9 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
JDK-8254341 | openjdk8u282 | Goetz Lindenmaier | P3 | Resolved | Fixed | b01 |
JDK-8244517 | 8u271 | David Buck | P3 | Resolved | Fixed | b01 |
JDK-8251595 | emb-8u271 | David Buck | P3 | Resolved | Fixed | team |
fastdebug builds of 8u and 11u result in the following warning when compiling with gcc 8.3:
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp: In static member function 'static void ClassLoader::compile_the_world_in(char*, Handle, Thread*)':
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp:2039:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(buffer, name, len - 6);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp:173:26: note: length computed here
size_t str_len = strlen(str);
~~~~~~^~~~~
This warning will cause builds to fail when warnings-as-errors is enabled (the default).
This code was removed in JDK 12 (seeJDK-8213812), so JDK 11 and JDK 8 are the only LTS versions that need to be fixed. There are a number of similar issues elsewhere in 11u, but they can hopefully be addressed by backporting preexisting fixes from later releases.
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp: In static member function 'static void ClassLoader::compile_the_world_in(char*, Handle, Thread*)':
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp:2039:12: warning: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(buffer, name, len - 6);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/home/dbuck/backports/sanity/jdk11u-cpu/open/src/hotspot/share/classfile/classLoader.cpp:173:26: note: length computed here
size_t str_len = strlen(str);
~~~~~~^~~~~
This warning will cause builds to fail when warnings-as-errors is enabled (the default).
This code was removed in JDK 12 (see
- backported by
-
JDK-8244517 stringop-overflow warning on strncpy call from compile_the_world_in
- Resolved
-
JDK-8247317 stringop-overflow warning on strncpy call from compile_the_world_in
- Resolved
-
JDK-8251595 stringop-overflow warning on strncpy call from compile_the_world_in
- Resolved
-
JDK-8254341 stringop-overflow warning on strncpy call from compile_the_world_in
- Resolved
- relates to
-
JDK-8205201 Problematic strncpy usage causes compiler warning on Fedora 28
- Closed
-
JDK-8213153 Clean up GCC 8 errors
- Closed
(1 relates to)