Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312069

Summary: FileReader catches and eats Throwable
Product: [Eclipse Project] Equinox Reporter: Jeff McAffer <jeffmcaffer>
Component: p2Assignee: Matthew Piggott <matthew>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: Ed.Merks, irbull, mn, pascal, remy.suen, steffen.pingel, timo.kinnunen
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Jeff McAffer CLA 2010-05-07 10:25:41 EDT
in FileReader.sendRetrieveRequest there is try/catch block with one of the catch clauses mentioning Throwable. This is in general pretty dangerous particularly if nothing is done with the Throwable.  For example, catching and ignoring ThreadDeath or OOM can be problematic.  (see the various SafeRunnables).

In my particular case, ECF was failing on a class verification problem and the exception was getting eaten in FileReader.

Ok, that was annoying but not tragic. Other things like OOM and ThreadDeath would be more of a problem.  Perhaps we should look at using SafeRunnables or some such.
Comment 1 Matthew Piggott CLA 2011-10-13 13:07:51 EDT
*** Bug 360857 has been marked as a duplicate of this bug. ***
Comment 2 Steffen Pingel CLA 2011-10-13 13:40:18 EDT
Please at least report the exception. It's likely to be an indication of a serious problem and it's impossible at the moment to even diagnose that without the use of a debugger.
Comment 3 Timo Kinnunen CLA 2014-09-13 10:40:13 EDT
Just encountered this bug via Eclipse Marketplace Client on Windows 8. 

When the Throwable is swallowed within FileReader.read(URI url, IProgressMonitor monitor) method call the returned InputStream is in invalid state. The InputStream forwards to a PipedInputStream which should be connected to a PipedOutputStream, but due to the swallowed exception a failure to establish the write side of the pipe is not noticed. This causes the returned InputStream to just block indefinitely while the PipedInputStream is waiting for a write side that isn't going to appear.

For a fix, simply removing the catch(Throwable t) block located in org.eclipse.equinox.internal.p2.transport.ecf.FileReader.java:426 allows the UI to instantly recover. It also let's the Marketplace Client swallow the exception instead (DOH!).
Comment 4 Ed Merks CLA 2020-02-19 05:55:22 EST
I don't know why it's still like this.  This just looks bad and wrong...
Comment 5 Eclipse Genie CLA 2022-02-09 09:57:37 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Ed Merks CLA 2022-02-09 11:01:50 EST
It's maybe still but it's still not fixed.