| Summary: | Race condition in IOConsolePartitioner causes console output to be lost | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Petar Petrov <petar.petrov> | ||||
| Component: | Debug | Assignee: | Paul Pazderski <paul-eclipse> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | dh_tue, paul-eclipse, petar.petrov, sarika.sinha | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 4.15 M3 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: |
https://git.eclipse.org/r/155654 https://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=1cf22e3c35e548b84bd22a7341b4ea06e97804b3 |
||||||
| Whiteboard: | 4.15 M2 | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 553348 | ||||||
| Attachments: |
|
||||||
|
Description
Petar Petrov
This is still an issue. I have an idea how to fix it but first want to merge my other pending console changes or I conflict with myself. Moved to M3, please change if you have some other plans. *** Bug 323816 has been marked as a duplicate of this bug. *** New Gerrit change created: https://git.eclipse.org/r/155654 Apart from the reported situation with print after clear and the later printed content is falsely cleared the reversed situation is also possible. It is just less useful but also possible that a print immediately followed by clear still shows the printed content in console.
If a user does the following in a single thread:
outStream.print("First");
console.clearConsole();
outStream.print("Second");
he can expect to see only "Second" in console and after this change it should be the case.
Created attachment 281477 [details] Plugin to test race condition I made a small plugin for verification. It adds a test console (ClearConsole) and a test button/icon in Console view (eclipse icon). In fact the button is added and usable on each MessageConsole. The button execute similar code as in my example above. Print "must be cleared" Clear Print "must be shown" Before fix with race condition described in comment 0 the actual result is an empty console. In the other race condition I added it shows both strings. In fixed console only the second string is visible. Gerrit change https://git.eclipse.org/r/155654 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.debug.git/commit/?id=1cf22e3c35e548b84bd22a7341b4ea06e97804b3 (In reply to Paul Pazderski from comment #1) > This is still an issue. I have an idea how to fix it but first want to merge > my other pending console changes or I conflict with myself. Old implementation set next trim offset to -1 and the trim job removes all if offset is -1. The idea and fix is to use the current document length when clear is called as trim offset. This way content added after clear but before trim is not cleared anymore. |