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

MustavData duke at openjdk.org
Fri Mar 1 21:42:02 UTC 2024


On Mon, 29 Jan 2024 20:56:42 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> 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)
>
> @MustavData, according to the line number, you're using a build without Segey's fix:
> 
> https://github.com/openjdk/jdk/blob/bff7725b4d81c12c0c826933fc2ad4f49a227536/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java#L114-L117
> 
> In the file with this fix, the line number where the exception is thrown is 119:
> 
> https://github.com/openjdk/jdk/blob/b25ed57b764fc485e4e8ca4118ffb1cc70fdfe7f/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java#L118-L121

@aivanov-jdk , thanks for the clarification.   I've re-run my tests using a more recent build (see below), and they now work as expected -  as they do with JDK 15 and prior.

OpenJDK:  "Oracle Corporation", "23-ea+11-814", "x86_64", ".:git:cc1e216eb9e4"
OS:  Windows 11, version 22H2, Build 22621.3007, VC++ 2015-2022 Runtime version 14.38.33130.0

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

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


More information about the client-libs-dev mailing list