On Thu, 19 Dec 2024 18:07:45 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

> The headful test run passed on Windows. While doing manual testing of other 
> settings (since the notification logic has changed), I discovered a 
> reproducible crash on Windows 11:
> 
> 1. Run the manual `PlatformPreferencesChangedTest` app (or any other JavaFX 
> app)
> 2. Toggle Settings --> Accessibility --> Visual effects --> Animation effects
> 
> JavaFX will crash, likely in response to the notification of a change in 
> animation effect.

This is a weird one. I've narrowed it down to 
`INetworkInformation::GetInternetConnectionProfile` returning `null`, and then 
crashing the app. Now, this method is specified to return `null` if there's no 
connection profile, so a null-check is obviously in order.

What is strange is that at least on my machine, `GetInternetConnectionProfile` 
always returns a non-null value _except_ when the method is called in response 
to receiving `WM_SETCLIENTAREAANIMATION`. Note that the method doesn't fail 
with an error, it simply returns `null`. I've checked all "obvious" things that 
might go wrong, such as calling the method on a wrong thread (not the case, 
it's always the same thread, regardless of whether we react to a window message 
or a WinRT callback).

The quick fix in this case is simply not calling the API in question in 
response to the unrelated `WM_SETCLIENTAREAANIMATION` message. I've added a 
parameter to `collectPreferences()` that indicates what type of preferences 
we're going to collect.

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

PR Comment: https://git.openjdk.org/jfx/pull/1656#issuecomment-2555776513

Reply via email to