Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » External process console trace corrupted ?(Console corruption )
External process console trace corrupted ? [message #1747145] Thu, 10 November 2016 08:25 Go to next message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
Hello,

I'm developing some plugins to an eclipse workbench IDE adding some dedicated toolchain to CDT and external process trigger to reach a physical target.

All was working fine i.e. once my external process triggered Thks some dedicated thread, such process STDOUT is well displayed within eclipse console.

Then I've had to add a new feature providing capability to analyze such external process trace if some exception occur. So :
- I've added a new non blocking Worker at external process start to populate a list with its trace content
- Once an exception occur such trace is fully available for post processing. Post processing is triggered thks a statusHandler extension point usage.

Here is my code to populate my trace list.

private class ExternalProcessErrorStreamHandler implements Callable<Object> {

private Process p;
private final List<String> inputStreamDataList;

ExternalProcessErrorStreamHandler(Process p) {
this.p = p;
this.inputStreamDataList = new ArrayList<String>();
}

@Override
public Object call() throws InterruptedException {
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
try {
while ((line = br.readLine()) != null) {
this.inputStreamDataList.add(line);
}
} catch (IOException e) {
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

// Exception is raised in any case once related process is
// terminated (whatever regular termination or abort)
throw new InterruptedException(join(MSG_STACK_SEPARATOR, inputStreamDataList.toArray(new String[0])));
}
}

Everything is working fine except .... native console content is now randomly corrupted. My list trace content is ok but within console some characters may be randomly skipped ???

Any advice about ! Help more than welcome ...
Thks.
Br,
Re: External process console trace corrupted ? [message #1749439 is a reply to message #1747145] Tue, 06 December 2016 18:14 Go to previous message
opendev cartu38 is currently offline opendev cartu38Friend
Messages: 14
Registered: June 2016
Junior Member
All,

I've finally understood issue root source.
1) My external process is Stream provider.
2) Eclipse's console is Stream consumer.
3) I'm trying to add a new consumer on same Stream ....
Issue is so one provider but multiple consumers ... each not procesing Stream at same speed / time ...

I've solved my issue adding an extra process to clone native Stream between producer and consumers.

Thks.
Previous Topic:Problem creating new android project
Next Topic:Bad connection: Problem to download "Remote systems Explorer"
Goto Forum:
  


Current Time: Thu Oct 22 07:41:48 GMT 2020

Powered by FUDForum. Page generated in 0.03079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top