-
Task
-
Resolution: Delivered
-
P4
-
12
== Excess strncat limits ==
src/hotspot/share/adlc/dfa.cpp:724:14: error: 'char* strncat(char*, const char*, size_t)' specified bound 2048 equals destination size [-Werror=stringop-overflow=]
strncat(string_buffer, "+", STRING_BUFFER_LENGTH);
Buffers are declared like:
char Expr::string_buffer[STRING_BUFFER_LENGTH];
So all such usages should use "STRING_BUFFER_LENGTH - 1".
Also:
src/hotspot/share/classfile/classLoader.cpp:1233:53: error: argument to ‘sizeof’ in ‘char* strncpy(char*, const char*, size_t)’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(&file_name[class_name_len], class_suffix, sizeof(class_suffix));
class_suffix already includes NULL and strncpy adds one more, so it looks like there also should be " - 1".
== Class arrays zeroing ===
In multiple places there are errors reported like:
src/hotspot/share/services/memoryManager.cpp:172:40: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class MemoryUsage’; use assignment or value-initialization instead [-Werror=class-memaccess]
memset(_before_gc_usage_array, 0, len);
^
Can be fixed by casting to void*.
- relates to
-
JDK-8219676 Re-enable harfbuzz warnings
- Resolved
-
JDK-8214377 ZGC: Don't use memset to initialize array of ZForwardingTableEntry
- Resolved
-
JDK-8214059 Undefined behaviour in ADLC
- Resolved
-
JDK-8214061 Buffer written into itself
- Resolved
-
JDK-8214777 Avoid some GCC 8.X strncpy() errors in HotSpot
- Resolved
-
JDK-8214854 JDWP: Unforseen output truncation in logging
- Resolved
-
JDK-8215009 GCC 8 compilation error in libjli
- Resolved
-
JDK-8215130 Fix errors in LittleCMS 2.9 reported by GCC 8
- Resolved
-
JDK-8215976 OpenJDK fails to build with GCC 8.2 when the #include<time.h> inside zip.cpp comes from a non-sysroot path
- Resolved
-
JDK-8210782 Upgrade HarfBuzz to 2.3.1
- Closed
-
JDK-8214776 Avoid GCC 8.X strncpy() errors in JFR code
- Closed
-
JDK-8220070 Clean up GCC 8.3 errors
- Open
-
JDK-8213745 Don't use memset to initialize array of RegMask in matcher.cpp
- Resolved
-
JDK-8214272 Don't use memset to initialize arrays of MemoryUsage in memoryManager.cpp
- Resolved
-
JDK-8214376 Don't use memset to initialize array of Bundle in output.cpp
- Resolved
-
JDK-8214707 Prevent GCC 8 from reporting error in ClassLoader::file_name_for_class_name()
- Resolved
-
JDK-8218935 Make jfr strncpy uses GCC 8.x friendly
- Resolved
-
JDK-8218937 Make mlvmJvmtiUtils strncpy uses GCC 8.x friendly
- Resolved
-
JDK-8219675 Disable harfbuzz warnings with gcc 8
- Resolved
-
JDK-8214123 Fix Harfbuzz 1.8.2 errors reported by GCC8
- Closed
-
JDK-8214363 HeapWord should not be a fake class
- Resolved
-
JDK-8244225 stringop-overflow warning on strncpy call from compile_the_world_in
- Resolved
-
JDK-8214444 Wrong strncat limits in dfa.cpp
- Resolved
-
JDK-8219142 Remove unused JIMAGE_ResourcePath
- Resolved