Integrated: 8299329: Assertion failure with fastdebug build when trying to use CDS without classpath
Ashutosh Mehra
duke at openjdk.org
Thu Jan 5 16:12:55 UTC 2023
On Fri, 23 Dec 2022 17:11:28 GMT, Ashutosh Mehra <duke at openjdk.org> wrote:
> 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>
This pull request has now been integrated.
Changeset: be64bf8c
Author: Ashutosh Mehra <asmehra at redhat.com>
Committer: Calvin Cheung <ccheung at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/be64bf8cf085c17b8e405b9447357ae59ef21765
Stats: 45 lines in 3 files changed: 36 ins; 1 del; 8 mod
8299329: Assertion failure with fastdebug build when trying to use CDS without classpath
Reviewed-by: iklam, ccheung
-------------
PR: https://git.openjdk.org/jdk/pull/11781
More information about the hotspot-runtime-dev
mailing list