Bug 539126 - Random freeze when LSP logs on console
Summary: Random freeze when LSP logs on console
Status: UNCONFIRMED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: LSP4E (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-16 18:13 EDT by Nicola Orru CLA
Modified: 2022-02-04 09:12 EST (History)
3 users (show)

See Also:


Attachments
JStack with blocked thread (38.25 KB, text/plain)
2019-02-02 18:36 EST, Nicola Orru CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicola Orru CLA 2018-09-16 18:13:30 EDT
Seeng using Corrosion.

I had it freezing on me twice, while editing Rust code. Waiting didn't solve the issue and each time I had to forcibly terminate the IDE.

This only works when LSP logs on the console.

There seems to be a deadlock of sorts in the main thread which is triggered randomly:


"main" #1 prio=6 os_prio=0 tid=0x0000000000f75000 nid=0x4a85 waiting for monitor entry [0x00007ffe47fc3000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.eclipse.ui.console.IOConsoleOutputStream.isClosed(IOConsoleOutputStream.java:159)
	- waiting to lock <0x000000048f2662f0> (a org.eclipse.ui.console.MessageConsoleStream)
	at org.eclipse.lsp4e.LoggingStreamConnectionProviderProxy.logToConsole(LoggingStreamConnectionProviderProxy.java:223)
	at org.eclipse.lsp4e.LoggingStreamConnectionProviderProxy.access$4(LoggingStreamConnectionProviderProxy.java:222)
	at org.eclipse.lsp4e.LoggingStreamConnectionProviderProxy$4.write(LoggingStreamConnectionProviderProxy.java:164)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageConsumer.consume(StreamMessageConsumer.java:63)


https://github.com/eclipse/corrosion/issues/128
Comment 1 Mickael Istria CLA 2018-11-20 08:42:10 EST

*** This bug has been marked as a duplicate of bug 540852 ***
Comment 2 Mickael Istria CLA 2018-11-23 03:21:12 EST
Doesn't seem like a dup of the other bug in the end.
Does this still happen to you? When it happens, please share the full output of jstack.
Comment 3 Nicola Orru CLA 2019-02-02 18:36:29 EST
Created attachment 277410 [details]
JStack with blocked thread
Comment 4 Nicola Orru CLA 2019-02-02 18:36:58 EST
I've re-enabled Console logging to test and this bug is not solved.
Comment 5 Nicola Orru CLA 2019-02-02 18:38:30 EST
Latest lsp4e snapshot as for 02/02/2019
Comment 6 Mickael Istria CLA 2019-02-03 04:15:43 EST
I'm considering maybe getting rid of consoleLog would be a better approach as logging to the console has a lot of side effect while logging into file seems enough in the vast majority of cases.
What do you think?
Comment 7 Martin Lippert CLA 2019-02-05 03:53:43 EST
I think logging into a file would be good enough, but in that case the preference page should get a button for directly opening the log file in an editor and probably another button to copy the path to the clipboard or reveal the file in the system explorer, so that users have an easy way to find the log output.
Comment 8 Mickael Istria CLA 2021-11-16 15:55:16 EST
Eclipse LSP4E is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/lsp4e/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest LSP4E snapshots (from https://download.eclipse.org/lsp4e/snapshots )
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present with snapshots:
* Create a new issue at https://github.com/eclipse/lsp4e/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed soon. Then the Bugzilla component for LSP4E will be archived and made read-only.