You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Adrian Moerchen (Created) (JIRA)" <ji...@apache.org> on 2012/02/17 15:19:59 UTC

[jira] [Created] (SANSELAN-63) Faulty image will be locked on the file system

Faulty image will be locked on the file system
----------------------------------------------

                 Key: SANSELAN-63
                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
             Project: Commons Sanselan
          Issue Type: Bug
    Affects Versions: 0.94-incubator
         Environment: Windows 7, Java 1.7.0.1
            Reporter: Adrian Moerchen
         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp

The attached image is somehow corrupt (it still can be opened with IrfanView).

Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.

After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SANSELAN-63) Audit and fix resource leaks

Posted by "Damjan Jovanovic (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic resolved SANSELAN-63.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

Audited and fixed all ByteSource.getInputStream() leaks in commit 1294807, resolving FIXED :-).

                
> Audit and fix resource leaks
> ----------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>             Fix For: 1.0
>
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp, finbugs.patch
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-63) Audit and fix resource leaks

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212336#comment-13212336 ] 

Damjan Jovanovic commented on SANSELAN-63:
------------------------------------------

Thank you for your patch, that's a great Maven plugin. Sadly "mvn site" is broken at the moment due to http://jira.codehaus.org/browse/MCLIRR-36 - this being the second Maven plugin bug I am having to fix - so I can't use your patch yet.

I want to release as soon as possible, but there's a lot left to do, including a rename of the project to "Apache Commons Imaging". Maybe by the end of Q1 2012.

                
> Audit and fix resource leaks
> ----------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp, finbugs.patch
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-63) Faulty image will be locked on the file system

Posted by "Adrian Moerchen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Moerchen updated SANSELAN-63:
------------------------------------

          Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator  (was: Windows 7, Java 1.7.0.1)
    Affects Version/s:     (was: 0.94-incubator)
                       0.97
    
> Faulty image will be locked on the file system
> ----------------------------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-63) Audit and fix resource leaks

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212649#comment-13212649 ] 

Damjan Jovanovic commented on SANSELAN-63:
------------------------------------------

Ok I've hacked MCLIRR to work, and committed your patch. Thank you for your contribution.

It finds all kinds of problems, but doesn't find the resource leak in BmpImageParser :-(. Maybe because ByteSource.getInputStream() returns the stream, and FindBugs can only find streams that leak within a method? Either way, I'll audit all the calls to ByteSource.getInputStream().

                
> Audit and fix resource leaks
> ----------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp, finbugs.patch
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-63) Audit and fix resource leaks

Posted by "Adrian Moerchen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Moerchen updated SANSELAN-63:
------------------------------------

    Attachment: finbugs.patch

I've recommend you to use Findbugs. I've attached a patch for you {{pom.xml}}. After applying the patch you can run {{mvn site}}. This will also generate the Findbugs analyses. There you can search for *OS_OPEN_STREAM* to find possible candidates where stream may left be open.

For developent you could add Findbugs to Eclipse or whatever you use.

Links:
http://findbugs.sourceforge.net/
http://mojo.codehaus.org/findbugs-maven-plugin/
http://findbugs.sourceforge.net/manual/eclipse.html


Btw. Is there a release date for the next version?
                
> Audit and fix resource leaks
> ----------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp, finbugs.patch
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-63) Faulty image will be locked on the file system

Posted by "Adrian Moerchen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Moerchen updated SANSELAN-63:
------------------------------------

    Attachment: 380440_295155317172029_185275861493309_985773_37867068_n.bmp
    
> Faulty image will be locked on the file system
> ----------------------------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.94-incubator
>         Environment: Windows 7, Java 1.7.0.1
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SANSELAN-63) Audit and fix resource leaks

Posted by "Damjan Jovanovic (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damjan Jovanovic updated SANSELAN-63:
-------------------------------------

    Summary: Audit and fix resource leaks  (was: Faulty image will be locked on the file system)
    
> Audit and fix resource leaks
> ----------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SANSELAN-63) Faulty image will be locked on the file system

Posted by "Damjan Jovanovic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANSELAN-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13210853#comment-13210853 ] 

Damjan Jovanovic commented on SANSELAN-63:
------------------------------------------

This probably happens because BmpImageParser.getImageInfo() calls byteSource.getInputStream() and never closes it, thus leaking that InputStream.

It's easy to fix with a try/finally around that one line of code, but the entire project should be audited for such leaks.

                
> Faulty image will be locked on the file system
> ----------------------------------------------
>
>                 Key: SANSELAN-63
>                 URL: https://issues.apache.org/jira/browse/SANSELAN-63
>             Project: Commons Sanselan
>          Issue Type: Bug
>    Affects Versions: 0.97
>         Environment: Windows 7, Java 1.7.0.1, 0.97-Incubator
>            Reporter: Adrian Moerchen
>         Attachments: 380440_295155317172029_185275861493309_985773_37867068_n.bmp
>
>
> The attached image is somehow corrupt (it still can be opened with IrfanView).
> Trying to read the image information with {{Sanselan.getImageInfo(file)}} results in an IOException.
> After this the image is still locked on the file system, and can't be deleted for example. I expected it to be immediately get unlocked on the file system, after the error occured.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira