JDK-8348106 : Catch C++ exception in Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9,21,23,24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2025-01-20
  • Updated: 2025-03-07
  • Resolved: 2025-02-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b12Fixed
Related Reports
Relates :  
Description
The JNI method Java_sun_awt_windows_WTaskbarPeer_setOverlayIcon calls CreateIconFromRaster that can throw a C++ exception.

The C++ exception must be caught and must not be allowed to escape the JNI method. The call to CreateIconFromRaster has to wrapped into a try-catch block.


Found this problem in code review [1] for JDK-8282862.

[1] https://github.com/openjdk/jdk/pull/22932#issuecomment-2602772897
Comments
Changeset: 39cb493c Branch: master Author: Rajat Mahajan <rmahajan@openjdk.org> Date: 2025-02-24 20:21:20 +0000 URL: https://git.openjdk.org/jdk/commit/39cb493c365778a1e3a6e753b49d8664733a3e26
24-02-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23470 Date: 2025-02-05 18:40:07 +0000
05-02-2025