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

GCC fortify error in vm_version_linux_aarch64.cpp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 24
    • hotspot
    • aarch64
    • linux

      As far as I can make out, this error is bogus. But since there is no way to switch off Fortify, this is still annoying.

      Seen on Fedora 40 with GCC 14.0.1

      ```

      * For target hotspot_variant-server_libjvm_objs_vm_version_linux_aarch64.o:
      In function ‘bool read_fully(const char*, char*, size_t)’,
          inlined from ‘static void VM_Version::get_compatible_board(char*, int)’ at /shared/projects/openjdk/jdk-jdk/source/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp:218:19:
      /shared/projects/openjdk/jdk-jdk/source/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp:188:29: error: argument 2 is null but the corresponding size argument 3 value is [1, 18446744073709551615] [-Werror=nonnull]
        188 | ssize_t read_sz = ::read(fd, buf, buflen);
            | ~~~~~~^~~~~~~~~~~~~~~~~
      In file included from /usr/include/bits/sigstksz.h:24,
                       from /usr/include/signal.h:328,
                       from /usr/include/sys/param.h:28,
                       from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/os/posix/include/jvm_md.h:35,
                       from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/share/runtime/os.hpp:28,
                       from /shared/projects/openjdk/jdk-jdk/source/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp:27:
      /usr/include/unistd.h: In static member function ‘static void VM_Version::get_compatible_board(char*, int)’:
      /usr/include/unistd.h:371:16: note: in a call to function ‘ssize_t read(int, void*, size_t)’ declared with attribute ‘access (write_only, 2, 3)’
        371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
            | ^~~~
         ... (rest of output omitted)
      ```

            Unassigned Unassigned
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: