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

[jdk8u] fail to build hotspot with gcc-8.4.0 with or without COMPILER_WARNINGS_FATAL

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hotspot
    • Environment:

      gcc version 8.4.0 (GCC)

       

      Description

      No matter what value of COMPILER_WARNINGS_FATAL is set,
      "make image" failed with following error (gcc warnings) with gcc-8.4.0

       ==========
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3848:14: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
             strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3848:61: note: length computed here
             strncpy(shared_archive_path, SharedArchiveFile, strlen(SharedArchiveFile) + 1);
                                                             ~~~~~~^~~~~~~~~~~~~~~~~~~
      Compiling /home/lzang1/Source/jdk8u/hotspot/src/share/vm/oops/arrayOop.cpp
      Compiling /home/lzang1/Source/jdk8u/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp: In static member function 'static void Arguments::fix_appclasspath()':
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
           strncpy(copy, src, strlen(src) + 1);
           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:30: note: length computed here
           strncpy(copy, src, strlen(src) + 1);
                              ~~~~~~^~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
           strncpy(copy, src, strlen(src) + 1);
           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/lzang1/Source/jdk8u/hotspot/src/share/vm/runtime/arguments.cpp:3459:30: note: length computed here
           strncpy(copy, src, strlen(src) + 1);

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lzang Lin Zang
                Reporter:
                lzang Lin Zang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: