Bug 484329 - ShowConsoleViewJob is not thread safe
Summary: ShowConsoleViewJob is not thread safe
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.5.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.6 M5   Edit
Assignee: Ghaith Hachem CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2015-12-14 10:47 EST by Ghaith Hachem CLA
Modified: 2016-03-14 10:12 EDT (History)
1 user (show)

See Also:


Attachments
Sample Xtext project with an extra Console that is brought to front on each build (328.93 KB, application/x-zip-compressed)
2015-12-14 10:47 EST, Ghaith Hachem CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ghaith Hachem CLA 2015-12-14 10:47:39 EST
Created attachment 258655 [details]
Sample Xtext project with an extra Console that is brought to front on each build

The runInUIThread method of the ShowConsoleViewJob access the console member of that class which could be changed by subsequent executions.

The issue would result in a null pointer exception that is reproducible in Xtext projects by having a console brought to front at each build while the console view is closed. On the Xtext side this is caused by a call to the manager.showConsoleView on a null console which in turn calls this job.

Calling the console manager with a null console should have simply schedule a job that eventually does nothing, since the job already checks for a null console, however it seems that this is not the case.

I have attached a sample xtext project where this issue would occur when the console is closed. 
To run it :
 - Import the project in a workspace where xtext is installed
 - Run an eclipse application (Make sure the targetplatform will include xtext)
 - Create a project
 - Create a file in the project with the extension .statemachine
 (
 - Close the console
 - Clean the project
 ) - Repeat twice
-> Null pointer
Comment 1 Eclipse Genie CLA 2015-12-14 10:51:50 EST
New Gerrit change created: https://git.eclipse.org/r/62639
Comment 2 Sarika Sinha CLA 2015-12-14 23:58:39 EST
Thanks for reporting the bug and providing the patch !!
Comment 3 Ghaith Hachem CLA 2016-01-20 01:23:29 EST
Since i'm not an eclipse  commiter, there should still be someone to review and submit my patch, but I noticed the bug is still assigned to me, is there something I can still do?
Comment 4 Sarika Sinha CLA 2016-01-20 01:32:27 EST
Thanks Ghaith, I am working on it to release the changes.
Comment 6 Sarika Sinha CLA 2016-01-20 04:40:50 EST
Changes has been released.
Comment 7 Sarika Sinha CLA 2016-01-25 00:09:02 EST
Verified using
Eclipse SDK

Version: Neon (4.6)
Build id: I20160124-2000