harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3602) [classlib][awt][drlvm][netbeans] ImageDecoder.terminate() interrupts current thread
Date Sat, 19 May 2007 11:20:16 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497144

Alexei Zakharov commented on HARMONY-3602:

Guys, I've applied the patch for class library code at r539728. Please check. I've also tried
to add the above test to Harmony test base: i.e. add the following

    public void testTerminate() {
        Image img = Toolkit.getDefaultToolkit().createImage(

        System.out.println(new ImageIcon(img)); // Loads the image.
        img.flush(); // ERROR: Calls Thread.currentThread().interrupt().
        assertFalse("Current thread is interrupted",

to org.apache.harmony.awt.tests.gl.image.ImageDecoderTest. But I was unable to reproduce the
failure if the test is executed by JUnit test runner. :(However, standalone test fails.

> [classlib][awt][drlvm][netbeans] ImageDecoder.terminate() interrupts current thread
> -----------------------------------------------------------------------------------
>                 Key: HARMONY-3602
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3602
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib, DRLVM
>            Reporter: Vasily Zakharov
>         Assigned To: Alexei Zakharov
>         Attachments: HARMONY-3602-ImageDecoder.patch, test.gif
> The following piece of code causes the current thread to be interrupted:
> public class Test {
>     public static void main(String args[]) throws Exception {
>         java.awt.Image img = java.awt.Toolkit.getDefaultToolkit().createImage(Thread.currentThread().getContextClassLoader().getResource("test.gif"));
>         new javax.swing.ImageIcon(img); // Loads the image.
>         img.flush(); // ERROR: Calls Thread.currentThread().interrupt().
>         System.out.println(Thread.currentThread().isInterrupted() ? "FAIL" : "SUCCESS");
>     }
> }
> Please put the attached test.gif (it's a trivial image, nothing special, but it should
exist) to current directory before running the test.
> The stack of calls causing the current thread to be interrupted is:
> 	org.apache.harmony.awt.gl.image.ImageDecoder.terminate() :128
> 	org.apache.harmony.awt.gl.image.DecodingImageSource.removeConsumer(ImageConsumer) :105
> 	org.apache.harmony.awt.gl.image.OffscreenImage.stopProduction() :426
> 	org.apache.harmony.awt.gl.image.OffscreenImage.flush() :133
> Probably ImageDecoder.terminate() should not use Thread.currentThread() do determine
a thread to interrupt.
> Output on RI:
> Output on Harmony/IBM VM:
> Output on Harmony/DRL VM:
> This looks like a clear AWT problem, however the problem only occurs on DRL VM, so probably
some issue (race condition, lack of synchronization or something like that) exists there also.
> The problem was discovered while trying to run NetBeans on Harmony.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message