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

[ASAN] ps_core.c report compile warning specified bound exceeds maximum object size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 25
    • hotspot
    • None
    • generic
    • linux

      File src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c reported compile warning "‘memset’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]" by gcc14 with enable sanitizer and release configure with gcc14.2.0.

      The configure command:
      bash configure --with-jobs=128 --prefix=/home/yansendao/git/jdk/install-release --verbose --with-debug-level=release --enable-unlimited-crypto --with-vendor-name=yansendao --with-vendor-url=https://github.com/sendaoYan --with-vendor-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-vendor-vm-bug-url=mailto:yansendao.ysd@alibaba-inc.com --with-jvm-variants=server --with-boot-jdk=/home/yansendao/software/jdk/24/jdk-repo-binary --with-gtest=/home/yansendao/git/googletest-v1.14.x --with-jtreg=/home/yansendao/software/jdk/jtreg-7.4 --with-jmh=build/jmh/jars --with-version-opt=a6277bb5 --with-zlib=system --enable-ccache --with-toolchain-type=gcc --with-toolchain-path=~/software/gcc/gcc-14.2.0-binary/bin --enable-asan --enable-ubsan --enable-lsan

      The compile warnings reported:
      src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c: In function ‘core_read_data’:
      src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c:144:10: error: ‘memset’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
        144 | memset(buf, 0, len);
            | ^~~~~~~~~~~~~~~~~~~
      cc1: all warnings being treated as errors

      The standalone compile command:
      gcc -MMD -MF build/linux-x86_64-server-release/support/native/jdk.hotspot.agent/libsaproc/ps_core.d.tmp -fpch-preprocess -fvisibility=hidden -pipe -fstack-protector -DLIBC=gnu -D_GNU_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DLINUX -DNDEBUG -fmacro-prefix-map=/home/yansendao/git/jdk/= -std=c11 -fno-strict-aliasing -Wall -Wextra -Wformat=2 -Wpointer-arith -Wreturn-type -Wsign-compare -Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function -Wunused-result -Wunused-value -m64 -D_LITTLE_ENDIAN -DARCH='"amd64"' -Damd64 -D_LP64=1 -fno-omit-frame-pointer -fno-lifetime-dse -fPIC -fsanitize=address -Wno-stringop-truncation -fno-omit-frame-pointer -fno-common -DADDRESS_SANITIZER --param asan-use-after-return=0 -fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER -fsanitize=leak -fno-omit-frame-pointer -DLEAK_SANITIZER -Isrc/jdk.hotspot.agent/linux/native/libsaproc -Isrc/jdk.hotspot.agent/share/native/libsaproc -Ibuild/linux-x86_64-server-release/support/headers/jdk.hotspot.agent -Isrc/hotspot/share/include -Isrc/hotspot/os/posix/include -Isrc/java.base/linux/native/libjava -Isrc/java.base/unix/native/libjava -Isrc/java.base/share/native/libjava -Ibuild/linux-x86_64-server-release/support/modules_include/java.base -Isrc/java.base/unix/native/include -Isrc/java.base/share/native/include -g -gdwarf-4 -fdebug-prefix-map=/home/yansendao/git/jdk/= -fdebug-prefix-map=/usr/include/=/usr/include/ -fdebug-prefix-map=/home/yansendao/software/gcc/gcc-14.2.0-binary/lib/gcc/x86_64-pc-linux-gnu/14.2.0/include/=/usr/local/gcc_include/ -fdebug-prefix-map=/home/yansendao/software/gcc/gcc-14.2.0-binary/include/c++/14.2.0/=/usr/local/gxx_include/ -fdebug-prefix-map=/home/yansendao/git/jdk/build/linux-x86_64-server-release/= -Wno-unused-parameter -Wno-sign-compare -Werror -O3 -Wno-pointer-arith -c -o build/linux-x86_64-server-release/support/native/jdk.hotspot.agent/libsaproc/ps_core.o src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c -frandom-seed="ps_core.c"

      gcc version:
      > gcc -v
      Using built-in specs.
      COLLECT_GCC=gcc
      COLLECT_LTO_WRAPPER=/home/yansendao/software/gcc/gcc-14.2.0-binary/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.2.0/lto-wrapper
      Target: x86_64-pc-linux-gnu
      Configured with: configure --prefix=/home/yansendao/git/tone-matrix-compiler/csmith/gcc-14.2.0/../gcc-14.2.0-binary --disable-multilib --enable-languages=c,c++,objc,obj-c++,fortran,lto
      Thread model: posix
      Supported LTO compression algorithms: zlib
      gcc version 14.2.0 (GCC)

            syan Sendao Yan
            syan Sendao Yan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: