Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with Emacs+LSP with v1.37.0 #1898

Closed
ijacquez opened this issue Aug 18, 2020 · 13 comments · Fixed by #1911
Closed

Exception with Emacs+LSP with v1.37.0 #1898

ijacquez opened this issue Aug 18, 2020 · 13 comments · Fixed by #1911

Comments

@ijacquez
Copy link

First, thank you to @david-driscoll for fixing the previous bug.

Just dropping in the latest version and starting LSP+Emacs shows:

Call stack
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object) ---> System.NullReferenceException: Object reference not set to an instance of an object
  at OmniSharp.Extensions.LanguageServer.Protocol.Models.WorkspaceFolder.GetHashCode () [0x00017] in <4df5ddc9a02a440392f86b08083438ea>:0 
  at System.Collections.Generic.GenericEqualityComparer`1[T].GetHashCode (T obj) [0x0000a] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Linq.Set`1[TElement].InternalGetHashCode (TElement value) [0x00008] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Set`1[TElement].Add (TElement value) [0x00000] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Enumerable+<ExceptIterator>d__57`1[TSource].MoveNext () [0x0008e] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) [0x0003d] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00033] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServerWorkspaceFolderManager.<Refresh>b__8_2 (OmniSharp.Extensions.LanguageServer.Protocol.Models.Container`1[T] workspaceFolders) [0x00087] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at System.Reactive.Linq.ObservableImpl.Do`1+OnNext+_[TSource].OnNext (TSource value) [0x00000] in <3a11ea46836344a282870ba916885e3d>:0 
--- End of stack trace from previous location where exception was thrown ---

  at OmniSharp.Extensions.LanguageServer.Server.LanguageServerWorkspaceFolderManager.OmniSharp.Extensions.LanguageServer.Protocol.Server.IOnLanguageServerStarted.OnStarted (OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServer server, System.Threading.CancellationToken cancellationToken) [0x000ea] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.Initialize (System.Threading.CancellationToken token) [0x001f3] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From (OmniSharp.Extensions.LanguageServer.Server.LanguageServerOptions options, System.IServiceProvider outerServiceProvider, System.Threading.CancellationToken cancellationToken) [0x0007d] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.LanguageServerProtocol.LanguageServerHost.Start () [0x0006d] in <6b8542d79d774e4886736f57f0959d30>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x0005e] in <cb5238bf2845403bb01d020e7f812523>:0 
  at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <5e17202ec9dc4b2a82315f63986c305c>:0 
  at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 
  at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <5e17202ec9dc4b2a82315f63986c305c>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <cb5238bf2845403bb01d020e7f812523>:0 
  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <5e17202ec9dc4b2a82315f63986c305c>:0 
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object
  at OmniSharp.Extensions.LanguageServer.Protocol.Models.WorkspaceFolder.GetHashCode () [0x00017] in <4df5ddc9a02a440392f86b08083438ea>:0 
  at System.Collections.Generic.GenericEqualityComparer`1[T].GetHashCode (T obj) [0x0000a] in <a17fa1457c5d44f2885ac746c1764ea5>:0 
  at System.Linq.Set`1[TElement].InternalGetHashCode (TElement value) [0x00008] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Set`1[TElement].Add (TElement value) [0x00000] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Enumerable+<ExceptIterator>d__57`1[TSource].MoveNext () [0x0008e] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Collections.Generic.LargeArrayBuilder`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] items) [0x0003d] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Collections.Generic.EnumerableHelpers.ToArray[T] (System.Collections.Generic.IEnumerable`1[T] source) [0x00033] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <a63e4875bcd94dc2960d31c0cf2bbd30>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServerWorkspaceFolderManager.<Refresh>b__8_2 (OmniSharp.Extensions.LanguageServer.Protocol.Models.Container`1[T] workspaceFolders) [0x00087] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at System.Reactive.Linq.ObservableImpl.Do`1+OnNext+_[TSource].OnNext (TSource value) [0x00000] in <3a11ea46836344a282870ba916885e3d>:0 
--- End of stack trace from previous location where exception was thrown ---

  at OmniSharp.Extensions.LanguageServer.Server.LanguageServerWorkspaceFolderManager.OmniSharp.Extensions.LanguageServer.Protocol.Server.IOnLanguageServerStarted.OnStarted (OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServer server, System.Threading.CancellationToken cancellationToken) [0x000ea] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.Initialize (System.Threading.CancellationToken token) [0x001f3] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From (OmniSharp.Extensions.LanguageServer.Server.LanguageServerOptions options, System.IServiceProvider outerServiceProvider, System.Threading.CancellationToken cancellationToken) [0x0007d] in <ce851f3cfc7a4c9cad08383e47d9500e>:0 
  at OmniSharp.LanguageServerProtocol.LanguageServerHost.Start () [0x0006d] in <6b8542d79d774e4886736f57f0959d30>:0 <---


Process csharp stderr finished

This was reported in the *csharp-stderr* buffer.

@easbarba
Copy link

Yep, its was working correctly in the last release (36.1)

@ijacquez
Copy link
Author

@elxbarbosa Are you experiencing this with Emacs as well?

I did call run -lsp and I didn't see an exception being thrown. That may mean that lsp-mode is doing something that's making it crash. I'm unsure how to debug this.

@easbarba
Copy link

easbarba commented Aug 22, 2020

@ijacquez

It seems to be unrelated to emacs lsp-mode and even omnisharp-roslyn, I think we found a bug in the csharp-language-protocol side...

As emacs ask it to refresh workspace it then crashes here: https://github.com/OmniSharp/csharp-language-server-protocol/blob/22389f385e89133b38fb257b9f64fb5b9e657e9b/src/Client/LanguageClientWorkspaceFoldersManager.cs#L35

@david-driscoll
Copy link
Member

yeah, there is an issue in the model: https://github.com/OmniSharp/csharp-language-server-protocol/pull/328/files#diff-88d8596ace2c16bc29dbcd1918ac5b8c

I've got the fixed merged there, and I'll get that released and update omnisharp-roslyn shortly.

This was referenced Aug 23, 2020
@R0flcopt3r
Copy link

Doesn't seem like this has been released yet? Newest release is still 1.37.0, and the bug is still there.

@ijacquez
Copy link
Author

@R0flcopt3r Check out the Azure pipeline builds. You can download the artifacts, which contain the build for that commit.

@R0flcopt3r
Copy link

Thanks! I was able to get it running using the artifacts! However it doesn't seem to detect the UnityEngine library..

@thomasheartman
Copy link

thomasheartman commented Sep 1, 2020

Sorry for jumping on this, but I was wondering the same thing as @R0flcopt3r. I'm glad to hear that you can use the artifacts from the Azure pipeline builds, but I don't understand how to find these artifacts. Would any of you be willing to explain to me how to find them?

I'm probably just missing something, but the section in the readme doesn't make it obvious how to find what I'm looking for.
It gives the format (https://roslynomnisharp.blob.core.windows.net/releases/{version}/{packagename}-{os/arch}.{ext}) and then a few rules for how the version, package name, etc., are decided. However, it says that version is auto-incremented and is visible in 'the travis or appveyor build output', but I don't know where to find the build output. I can't find any links to it either.

There's also a link to an XML feed of releases, but I can't quite make sense of the ordering (though it seems newer releases are at the end). When I tried searching for a release that was modified in 'Aug 2020', nothing came up.

Cheers.

@R0flcopt3r
Copy link

R0flcopt3r commented Sep 1, 2020

@thomasheartman here you go: https://dev.azure.com/omnisharp/Builds/_build/results?buildId=2273&view=artifacts&type=publishedArtifacts

The Packages is a archive containing all the various omnisharp builds also in archives, extract that and pick your relevant version. It's almost 1GB, and it doesn't seem to report it's size to whatever client you use to download it.

EDIT:
Should mention the link above contains the two commits relevant to this issue, and is not the actual latest version.

@filipw
Copy link
Member

filipw commented Sep 1, 2020

we will do a 1.37.1 release this week

@thomasheartman
Copy link

@R0flcopt3r Thanks a bunch! Downloading now, so fingers crossed 🤞 But how did you find this? How would I go about finding the artifacts next time I need this? It's not at all obvious to me how you found the pipelines and the artifacts.

@nickspoons
Copy link
Member

@thomasheartman click on the "Azure Pipelines" badge at the top of the README

@thomasheartman
Copy link

@nickspoons Oh, is that it? 😅 I hadn't even noticed the badge was there. Thanks! Would it be worth mentioning that in the section on downloading pre-releases, just to have all the necessary info gathered in one place?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants