RFR: 8270269: Desktop.browse method fails if earlier CoInitialize call as COINIT_MULTITHREADED [v3]

MustavData duke at openjdk.org
Fri Jan 26 20:20:47 UTC 2024


On Fri, 8 Dec 2023 17:12:29 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> The fix for a regression caused by the https://bugs.openjdk.org/browse/JDK-6508941. it does not take into account RPC_E_CHANGED_MODE when COM was already initialized using COINIT_MULTITHREADED mode.
>> 
>> @aivanov-jdk please take a look.
>
> Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
>   
>   date
>   
>   Co-authored-by: Alexey Ivanov <alexey.ivanov at oracle.com>

I am working to verify the initial fix of JDK-8270269 in OpenJDK 23 (beta).  The basic environment is:

    OpenJDK:  "Azul Systems, Inc.", "Zulu23+11-CA", "23-beta+1", "x86_64", ".:git:e278d5994c10+"
    OS:  Windows 11, version 22H2, Build 22621.3007, VC++ 2015-2022 Runtime version 14.38.33130.0

The test application is a Java client with the user successfully logged in, following initial launch, against a web application.  Here are the basic tests that need to pass:

1. Re-authentication after the standard web app timeout of 30 minutes, typically triggered when returning from lunch
2. Re-authentication after numerous hours, typically triggered when returning to work the next morning

Results so far:

1. Without the initial fix, the Test 1 fails as reported in JDK-8270269
2. With the initial fix, Test 1 succeeds, and Test 2 fails with a `java.io.IOException` thrown upon a failure in `CoInitializeEx()`

Here is the stack trace from the Test 2 failure:


java.io.IOException: Failed to open https://<web-app-url>. Error message: CoInitializeEx() failed.
	at java.desktop/sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:115)
	at java.desktop/sun.awt.windows.WDesktopPeer.browse(WDesktopPeer.java:101)
	at java.desktop/java.awt.Desktop.browse(Desktop.java:533)

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

PR Comment: https://git.openjdk.org/jdk/pull/17010#issuecomment-1912630377


More information about the client-libs-dev mailing list