Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349192 - SignatureBlockProcessor.readIntoArray(BundleEntry) does not close input stream
Summary: SignatureBlockProcessor.readIntoArray(BundleEntry) does not close input stream
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 3.7.1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 349121
Blocks:
  Show dependency tree
 
Reported: 2011-06-13 09:48 EDT by Thomas Watson CLA
Modified: 2011-06-30 12:04 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Watson CLA 2011-06-13 09:48:19 EDT
+++ This bug was initially created as a clone of Bug #349121 +++

From bug #300589, Stephan found the following:

OK, since this bug is still relevant, I had a quick look at the source of

org.eclipse.osgi.internal.signedcontent.SignatureBlockProcessor.readIntoArray(BundleEntry)

It looks like a very simply file handle leak here: the InputStream
"is" might be allocated in be.getInputStream() but is never closed.

Looks like a simple
  } finally {
     if (is != null) is.close();
  }
might solve the issue at this location (there might be more!!).

I'm pretty confident that this helps because I previously had the
same bug pattern in my code and the finally did fix one instance
of "Too many open files" :)


Then in a second comments he adds:
More evidence: the error message in bug 349073 reads
"Error reading signed content". That's logged from
org.eclipse.equinox.internal.p2.artifact.repository.SignatureVerifier.verifyContent()

When drilling into verifierFactory.getSignedContent(inputFile);
we actually get to the same readIntoArray() method mentioned in my
previous comment.
Comment 1 Thomas Watson CLA 2011-06-13 09:49:02 EDT
Patch from bug349192 will apply to 3.7.1.
Comment 2 Thomas Watson CLA 2011-06-17 15:15:07 EDT
Reducing severity.  I do not consider this bug to be severe.  It should only effect directory style bundles since the input streams from zip files will automatically get closed when the zip file is closed.  Also this bug has been around since 3.4 at least.
Comment 3 Stephan Herrmann CLA 2011-06-17 18:13:13 EDT
(In reply to comment #2)
> Reducing severity.  I do not consider this bug to be severe.  It should only
> effect directory style bundles since the input streams from zip files will
> automatically get closed when the zip file is closed.  Also this bug has been
> around since 3.4 at least.

I won't argue with you about severity as triggering this bug seems to be 
rare indeed. Just wanted to mention that when I first saw indications of
this bug the effect was that eclipse wiped itself off the disk -
- not exactly nice :)
Comment 4 Thomas Watson CLA 2011-06-30 12:04:28 EDT
patch released to 3.7 maint branch.