RFR: 8299329: Assertion failure with fastdebug build when trying to use CDS without classpath [v5]

Ashutosh Mehra duke at openjdk.org
Thu Jan 5 03:09:16 UTC 2023


> It appears longest_common_app_classpath_prefix_len() is not returning correct value when there is no file separator in the path being searched backwards. Instead of returning 0 it return 1.
> 
> In case of empty classpath, it can result in assertion failure in check_paths():
> 
> `assert(strlen(rp_array->at(i)) > (size_t)runtime_prefix_len, "sanity");`
> 
> It can also result in incorrectly validating the app classpaths if they only differ by first character. Eg:
> 
> Dump time:
>   -cp hello.jar
> Run time:
>   -cp mello.jar
> 
> This would not result in classpath mismatch!
> 
> This fix updates longest_common_app_classpath_prefix_len() to return 0 if no file separator character is found.
> 
> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

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

  Add spaces
  
  Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11781/files
  - new: https://git.openjdk.org/jdk/pull/11781/files/e4fec7e7..5684e67c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11781&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11781&range=03-04

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11781.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11781/head:pull/11781

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


More information about the hotspot-runtime-dev mailing list