RFR: 6726901: JDWP: ReferenceType.GetValues crashes jvm in case non-static fields are passed

Adam Bruce duke at openjdk.org
Wed Nov 20 18:33:43 UTC 2024


This PR fixes a long-standing bug in JDWP where the access flags of a field are not checked before attempting to read it's value. 

Prior to this change, attempting to read a non-static field would cause a JVM crash, this change corrects that behaviour by returning `INVALID_FIELDID` instead.

This is my first PR to OpenJDK, so please let me know if I've made any mistakes in the process.

Cheers,
Adam

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

Commit messages:
 - Check for ACC_STATIC before writing static field value

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

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


More information about the serviceability-dev mailing list