JDK-6176679 : Application freezes when copying an animated gif image to the system clipboard
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0,8,11,17,19,20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2004-10-09
  • Updated: 2023-09-29
  • Resolved: 2023-05-05
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 11 JDK 17 JDK 21 JDK 8
11.0.21-oracleFixed 17.0.9-oracleFixed 21 b22Fixed 8u381Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
I have implemented my own transferable object that represents an image and it's associated flavors. I am creating a transferable out of an animated gif image and setting it to the System Clipboard through SysClipboard.setContents(). As soon as I call this method, the application freezes and I had to eventually kill it by pressing CTRL+C. This is noticed only on Win32 platforms and not on Solaris / Linux. This is happening only for animated images and not for normal images. This is noticed on Tiger as well as Mustang.

I have attached a sample test. Execute the sample test. You would see a frame with 2 buttons and 2 canvases. One of the canvases will show an animated java logo. Click 'Copy' button. After that, if the frame freezes, the bug is reproduced.
###@###.### 10/9/04 13:51 GMT

EDITED:
As of December 2022, this issue continues to reproduce using newer Java versions.  Also, the issue is reproducible with both 32bit and 64bit on both Windows and Linux.  Unclear why it was claimed to not reproduced on 64 and Unix/Linux when originally filed.  Regarding the ability to "Ctrl+C" as an escape, this is not acceptable.  A crash is a crash thereby making any application impacted by the issue unusable.
 
Comments
Fx request [11u] This is for parity with 11.0.21-oracle. Patch applies cleanly except for a copyright year mismatch. Build and test (SAP overnight) successful.
25-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2055 Date: 2023-07-21 11:12:38 +0000
21-07-2023

Fix request [17u] I backport this for parity with 17.0.9-oracle. Low risk, small fix in desktop. Clean backport. Test passes, but also passes without the fix. SAP nightly testing passed.
06-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1546 Date: 2023-07-05 12:01:55 +0000
05-07-2023

Changeset: 6c71859a Author: Rajat Mahajan <rmahajan@openjdk.org> Committer: Alexey Ivanov <aivanov@openjdk.org> Date: 2023-05-05 18:03:58 +0000 URL: https://git.openjdk.org/jdk/commit/6c71859ac240c788364169422e726f8f5443bf75
05-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13414 Date: 2023-04-10 21:32:30 +0000
11-04-2023

I have reproduced the issue locally on my Windows machine with OpenJDK and see the application freeze reported. Debugging further.
24-12-2022

EVALUATION The reconstruct method is used in DataTransferer.imageToStandardBytes(). NB. Now we use animation for TryIcon. We should also support animated GIF in frame icons and for the clipboard. One of ideas is to extract all handling for the operations above in a separate animated thread.
05-02-2007

EVALUATION The same issue as 4088017 (Animated GIF as Frame's icon image hangs java): sun.awt.image.ImageRepresentation.reconstruct(ImageObserver.ALLBITS) hangs if the corresponging image is multiframe. ###@###.### 10/11/04 08:34 GMT
11-10-2004