RFR: 8348567: [ASAN] Memory access partially overflows by NativeCallStack

SendaoYan syan at openjdk.org
Fri Jan 24 11:47:15 UTC 2025


Hi all,
This PR fix a undefined behaviour in 'CollisionsReceiveDifferentIndexes' testcase 
locate in 'test/hotspot/gtest/nmt/test_nmt_nativecallstackstorage.cpp' file when call `NativeCallStack::NativeCallStack` function. Before this PR, 'CollisionsReceiveDifferentIndexes' test allocate 4 type variable `i` and then pass the address `&i`, but in 'NativeCallStack' function read the pointer as 8 types, so the AddressSanitizer report "Memory access partially overflows variable i". This PR change the variable `i` to `size_t` to avoid this undefined behaviour.
Change has been verified locally, test-fix only, no risk.

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

Commit messages:
 - 8348567: [ASAN] Memory access partially overflows by NativeCallStack

Changes: https://git.openjdk.org/jdk/pull/23294/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23294&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8348567
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23294.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23294/head:pull/23294

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


More information about the serviceability-dev mailing list