Integrated: JDK-8283401: ArrayIndexOutOfBoundsException when disconnecting screen(s)

Marius Hanl mhanl at openjdk.org
Fri Aug 11 22:36:34 UTC 2023


On Sat, 5 Aug 2023 13:00:36 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> When the `D3DPipeline` is reinitialized, the adapter ordinal of all the `Screen`s are outdated.
> As a consequence, when a `D3DResourceFactory` is created for a `Screen` (adapter ordinal), the code may fail with an `ArrayIndexOutOfBoundsException` as the ordinal is higher than what we would expect it to be.
> 
> Example:
> We have 3 screens. Adapter ordinal 0, 1, 2.
> If we now disconnect 2 screens, we only have one screen left. 
> The `D3DPipeline` is reinitialized as a [D3DERR_DEVICEREMOVED](https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3derr) is reported from Direct3d9.
> Now the remaining screen may have the adapter ordinal 1 (from before). But since we only have 1 screen left, it should have the adapter ordinal 0. 
> 
> Direct3d9 will also return 0 as adapter ordinal if you call it. And that is what we do to update the `Screen` and fix this problem.
> 
> See also the ticket for information how to reproduce this problem (Windows only).

This pull request has now been integrated.

Changeset: a5183e53
Author:    Marius Hanl <mhanl at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/a5183e539eea3b175825a27b022c07316080c667
Stats:     6 lines in 1 file changed: 6 ins; 0 del; 0 mod

8283401: ArrayIndexOutOfBoundsException when disconnecting screen(s)

Reviewed-by: kcr, mstrauss

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

PR: https://git.openjdk.org/jfx/pull/1200


More information about the openjfx-dev mailing list