RFR: 8345043: [ASAN] methodMatcher.cpp report reading from a region of size 0 [-Werror=stringop-overread] [v2]

SendaoYan syan at openjdk.org
Wed Nov 27 15:20:24 UTC 2024


> Hi all,
> The file src/hotspot/share/compiler/methodMatcher.cpp report compile warning by gcc14 with -fsanitize=undefined -fsanitize=address `‘size_t strlen(const char*)’ reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]`. I think it's false positive, the `if (name[0] == '*')` and `if (strlen(name) == 1)` judgement has make sure that the length of name greater or equal to 2, but the static analyze at compile time is unable to identify that.
> So this PR add PRAGMA_DISABLE_GCC_WARNING("-Wstringop-overread") for the line to disable the false positive gcc warning.  Risk is low.

SendaoYan has updated the pull request incrementally with one additional commit since the last revision:

  combine the calacution of stelen

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/22406/files
  - new: https://git.openjdk.org/jdk/pull/22406/files/0d3768d5..a41e68ed

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22406&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22406&range=00-01

  Stats: 19 lines in 3 files changed: 1 ins; 14 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/22406.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22406/head:pull/22406

PR: https://git.openjdk.org/jdk/pull/22406


More information about the hotspot-dev mailing list