| Summary: | Build job gets stuck after being cancelled. | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Alain Lee <a-lee> |
| Component: | cdt-build | Assignee: | Project Inbox <cdt-core-inbox> |
| Status: | NEW --- | QA Contact: | Jonah Graham <jonah> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Alain Lee
After further investigation, I found the following: 1. Even though ProcessClosure.terminate() was invoked to execute fProcess.destroy(), Windows Task Manager showed gmake.exe was still running. It seemed that gmake got stuck as it never finished. 2. ProcessClosure got stuck in the OutputReader and ErrorReader threads. See below for the stack trace. Daemon Thread [ErrorReader] (Suspended) owns: InputStreamReader (id=218) SpawnerInputStream.read0(int, byte[], int) line: not available [native method] SpawnerInputStream.read(byte[], int, int) line: 66 StreamDecoder$CharsetSD.readBytes() line: not available StreamDecoder$CharsetSD.implRead(char[], int, int) line: not available StreamDecoder$CharsetSD(StreamDecoder).read(char[], int, int) line: not available InputStreamReader.read(char[], int, int) line: not available BufferedReader.fill() line: not available BufferedReader.readLine(boolean) line: not available BufferedReader.readLine() line: not available ProcessClosure$ReaderThread.run() line: 53 Daemon Thread [OutputReader] (Suspended) owns: InputStreamReader (id=224) SpawnerInputStream.read0(int, byte[], int) line: not available [native method] SpawnerInputStream.read(byte[], int, int) line: 66 StreamDecoder$CharsetSD.readBytes() line: not available StreamDecoder$CharsetSD.implRead(char[], int, int) line: not available StreamDecoder$CharsetSD(StreamDecoder).read(char[], int, int) line: not available InputStreamReader.read(char[], int, int) line: not available BufferedReader.fill() line: not available BufferedReader.readLine(boolean) line: not available BufferedReader.readLine() line: not available ProcessClosure$ReaderThread.run() line: 53 I found the following way to reproduce this problem:
1. In org.eclipse.cdt.internal.core.ProcessClosure.ReaderThread.run(), add the following breakpoints marked by 1>>> and 2>>>:
public void run() {
try {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(fInputStream));
String line;
1>>> while ((line = reader.readLine()) != null) {
line += lineSeparator;
fOutputStream.write(line.getBytes());
}
} catch (IOException x) {
// ignore
} finally {
try {
// writer.flush();
2>>> fOutputStream.flush();
} catch (IOException e) {
// ignore
}
try {
fInputStream.close();
} catch (IOException e) {
// ignore
}
}
} finally {
complete();
}
}
2. Build a project (preferrably a big project).
3. When the code stops at the breakpoint 1>>> in both the OutputReader and ErrorReader threads, cancel the build job via the progress dialog.
4. In the OutputReader and ErrorReader threads, disable the breakpoint 1>>> and let the code run.
5. The code never reaches the breakpoint 2>>>.
6. Pause the OutputReader and ErrorReader threads. The code should be waiting at reader.readLine().
7. Windows Task Manager shows that gmake.exe is still running.
|