Community
Participate
Working Groups
Build ID: M20060921-0945 Steps To Reproduce: 1. Install Eclipse 3.2.1 M20060921-0945 2. Install on top EMF/XSD 2.1.1 from http://download.eclipse.org/tools/emf/downloads/drops/2.2.2/M200612140300/emf-sdo-xsd-SDK-M200612140300.zip and TPTP-4.2.2-200612191126 from http://www.eclipse.org/downloads/download.php?file=/tptp/4.2.2/dev/TPTP-4.2.2-200612191126/tptp.sdk-TPTP-4.2.2-200612191126.zip. 3. Launch the workbench and from the main menu choose File->Import->Profiling and Logging->Log file 4. In the import log wizard choose Add and select to import the Apache access log file attached to this defect. 5. Click Finish to start importing the Apache log file and swithc to the "Profiling and Logging" perspective when asked. Notice the "Importing log file..." job label displayed on the status bar. If this status label is cleared try to import again the same log file and choose to replace the previously imported one. Notice that this time the status label doesn't go away although the job has finished. Sometimes the status label doesn't get cleared on the first log import. More information: I did some investigation and found out that the culprit for the label not being cleared is the fact that org.eclipse.ui.internal.progress.ProgressManager is not removing the import log job from it's jobs hash map in the method public void done(IJobChangeEvent event), part of the JobChangeAdapter created in */ private void createChangeListener() { changeListener = new JobChangeAdapter() {...} Not sure why this is happening only for this particular job. The problem is that all the subsequent import log jobs are not cleared and this is causing a memory leak which could become problematic. The org.eclipse.ui.internal.progress.ProgressCanvasViewer is using the org.eclipse.ui.internal.progress.ProgressViewerContentProvider and this one is using the org.eclipse.ui.internal.progress.ProgressManager to get it's content. This is the reason why the import log job name keeps getting displayed.
Created attachment 56232 [details] Sample Apache access log Attaching a sample Apache access log file required for reproducing the problem.
Changing sev to major since the problem is causing a memory leak which could potentially be troublesome.
The issue is in ImportLogWizard - you are calling done on the progress monitor after the job is finished so I am getting a request for info after I removed it from the cache. I'll need to see the source of this to see what the issue is but it looks like you are calling done() after the progress monitor is no longer valid
OK, I think I see the problem, but still I think this is a bit strange since I am pretty sure it didn't happen in previous releases of Eclipse. The same client code worked in Eclipse 3.1. I agree the clients have to be careful not to call done() on an "invalid" monitor, but would it be not good practice if also the Eclipse code, to be on the safe side, would ensure that initialization of the job info happens only on a valid monitor? Can you assign this defect to me please, i.e. apnan@ca.ibm.com. I have verified that by removing the unnecessary done() the problem dissapears. Thanks for your time and sorry for the inconvenience that this issue may have caused you.
Bob has retired and I cannot assign this defect to myself unfortunately.
Assign to Alex as requested
And in continuation of what I said before, according to the java doc of the IProgressMonitor interface, the done() method may be called more then once, implementations should be prepared to handle this case.
We certainly should protect against this - please feel free to log me a bug if you like. We should also specify in the javadoc of Job that the monitor should not be used outside of the life of the job
The problem is very similar to bug 149857.. the fix for that bug only fixed the case where isCanceled is called after the job completes, rather than fixing the general problem.
I have opened https://bugs.eclipse.org/bugs/show_bug.cgi?id=172327 for this issue. Not sure if Platform.UI is the right component though.
Fixed.
Verified with TPTP-4.4.0-200706070100
Closing.