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

Fixed known issue AsmDude2: unable to communicate with LSP on Windows 10 #146

Open
HJLebbink opened this issue Sep 30, 2023 · 23 comments
Open

Comments

@HJLebbink
Copy link
Owner

HJLebbink commented Sep 30, 2023

Known issue: AsmDude2 communicates with the LSP with pipes (https://learn.microsoft.com/en-us/windows/win32/ipc/pipes), this works nicely on all windows 11 machines I could my hands on. On the one Windows 10 machine I still have, whatever I try, I keep hitting the following issue.

image

If anyone knows a solution, do let me know!

@HJLebbink HJLebbink pinned this issue Sep 30, 2023
@ElDuderinoBerlin
Copy link

I have Windows 11 and it doesn't work.


Microsoft Visual Studio

AsmDude2 Language Server Protocol (LSP) failed to activate.
System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated.

at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)

at System.Security.Principal.NTAccount.Translate(Type targetType)

at System.Security.AccessControl.CommonObjectSecurity.ModifyAccess(AccessControlModification modification, AccessRule rule, Boolean& modified)

at System.Security.AccessControl.CommonObjectSecurity.AddAccessRule(AccessRule rule)

at AsmDude2.AsmLanguageClient.d__23.MoveNext() in C:\Source\Github\asm-dude\VS\CSHARP\asm-dude2-vsix\AsmLanguageClient.cs:line 269

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.VisualStudio.LanguageServer.Cl...

OK

@LeonsCodeLab
Copy link

Exactly the same for me.

@HJLebbink
Copy link
Owner Author

Still no help from Microsoft on this, and I'm at a loss what can cause it. I can easily reproduce the issue on one of my development machines, wasted more than 30 hours on trying to fix it. I'm sorry, I'm only an assembly programmer... not an Windows 10 internals hacker...

@MickeyNT
Copy link

MickeyNT commented Jan 8, 2024

Maybe this info helps you
The user group "Everyone" doesn't exist on my German Windows 11. So if I create the new group "Everyone" and add the "Jeder" group into it the above exception will be no more thrown. Unfortunately the syntax highlighting still doesn't work ..

@HJLebbink
Copy link
Owner Author

The thing is, these security and authentication details have changed between 10 and windows 11 (it seems), and nobody seems to care to figure this out for old windows versions.

@MickeyNT
Copy link

Hi @HJLebbink,

today I had a little bit time to try out the solution using SecurityIdentifier instead of named groups for creating PipeAccessRule(s).
It seems it works well (I also see the communication between VS 2022 and AsmDude2.LSP.exe) so I would just share my changes here. In the files

\repos\asm-dude\VS\CSHARP\asm-dude2-vsix\AsmLanguageClient.cs and
\repos\asm-dude\VS\CSHARP\asm-dude2-ls\Worker.cs

create PipeAccessRule as follows:
SecurityIdentifier everyone = new SecurityIdentifier(WellKnownSidType.WorldSid, null); PipeAccessRule pipeAccessRule = new(everyone, PipeAccessRights.ReadWrite, System.Security.AccessControl.AccessControlType.Allow);
I had trouble with the preview version of the MS LanguageServer packages so I made my changes based on
2b897a0

Regards from Stuttgart

@HJLebbink
Copy link
Owner Author

Thank you for your time; I'll look at it tonight straight away.

@HJLebbink
Copy link
Owner Author

@MickeyNT, thanx this seems to have fixed the issue for my windows 10 setup, i hope this will also fix it for those other users out there. Great thanx! See https://github.com/HJLebbink/asm-dude/releases/tag/v2.0.1.0

@Nespelem-3000
Copy link

It works!
asm_dude_win_10_fixed

@HJLebbink
Copy link
Owner Author

HJLebbink commented Feb 17, 2024

It works!

That is good news! TY for the update.

@HJLebbink HJLebbink changed the title Known issue AsmDude2: unable to communicate with LSP on Windows 10 Fixed known issue AsmDude2: unable to communicate with LSP on Windows 10 Feb 17, 2024
@lstrsrt
Copy link

lstrsrt commented Feb 21, 2024

Unfortunately still having this issue on 21H2 (19044). This error always comes up after a couple of minutes. I'll install a 22H2 VM tomorrow and see if it works there.

Pwcf0XvEYu_cropped

@HJLebbink
Copy link
Owner Author

@lstrsrt Please let me know if you keep having issues, or when you have solved this. I would like to understand what causes these issues.

@Kule02
Copy link

Kule02 commented Feb 28, 2024

It's also not working for me on Windows 10 Pro 22H2 OS build: 19045.3996. I'm not sure how to provide anything that could help narrow it down or fix it myself. I get the same message as lstrsrt along with this pop up in the bottom left.

Screenshot 2024-02-28 150801

@bastiel
Copy link

bastiel commented Feb 29, 2024

@HJLebbink I noticed that the highlighting settings work for everything except the registers. If I edit the colors or enable the italicization for the regiters, I'll get an LSP failed to activate error, but mine is because the path to AsmDude's LSP.exe was denied.

I've ran VS Studio as an admin and even installed via the Github installer but the errors are the same. It seems to be inconsistent for me because it'll work randomly on different W10 machines while others give the error.

@HJLebbink
Copy link
Owner Author

@Kule02

It's also not working for me on Windows 10 Pro 22H2 OS build: 19045.3996. I'm not sure how to provide anything that could help narrow it down or fix it myself. I get the same message as lstrsrt along with this pop up in the bottom left.

I didn't keep track of the windows versions that did not work for me (which would have been useful to understand the cause), but my working setup currently has 19045.4046. It must be some optional component that fixes or breaks this. Thus, you have the LSP running but connection to it times out?

@HJLebbink
Copy link
Owner Author

@bastiel I think the error "LSP failed to activate" is because the LSP could not start. You say that it works on some W10 boxes but not on others, On the machines that it does not work, is the LSP running, if not, is it even installed?

Everybody thanx for helping out. This is a nice example of "Hidden Windows Costs..."

@Kule02
Copy link

Kule02 commented Feb 29, 2024

@HJLebbink I updated to 19045.4046 but still no luck. The syntax highlighting (mostly) works, like bastiel mentioned. I tried disabling the syntax highlighting to see if anything would happen and I got this error:

Screenshot 2024-02-29 115433

If I leave the extension to timeout, it displays these errors:

Screenshot 2024-02-29 121559

Screenshot 2024-02-29 121706

@MickeyNT
Copy link

Hi,
On my old PC I have the German Windows 10 Home / 22H2 19045.4046. I have just installed VS 2022 and the current version of AsmDude2. The syntax highlighting works but after some time the above error message will be displayed. I can help to solve the issue however I could not find the LSP version 17.8.9-preview. How can I download it?
I would create a debug version and check the errors with it....

@Sudsey
Copy link

Sudsey commented Mar 9, 2024

Chiming in. On version 2.0.1.0, I get syntax highlighting, but no help-on-hover or suggestions. After a few minutes I get the same "AsmDude2 Language Server Protocol (LSP) failed to activate. ..." error as reported above. Windows 11 Home 23H2 22631.3155. Happy to pull out any logs or perform troubleshooting requested.

edit: Partially resolved - this is a new installation and the LSP required the .NET 7 Desktop Runtime, which wasn't installed. @Kule02 's output log was the clue - I didn't get that message, but running that executable in a terminal window spat out the standard missing runtime error. Help-on-hover now works but still no code suggestions.

@Yogurt4
Copy link

Yogurt4 commented Mar 20, 2024

Still having this problem.
Windows 10 22H2 19045.4123, VS Community 2022 (64-bit) 17.9.1, Asmdude2.v2-0-1-0
(By the way, why still 2.0.0.4 is the "latest" here while you can download 2.0.1.0 from the VS Marketplace?)

The same error as for @Kule02.

@bastiel
Copy link

bastiel commented Mar 28, 2024

@bastiel I think the error "LSP failed to activate" is because the LSP could not start. You say that it works on some W10 boxes but not on others, On the machines that it does not work, is the LSP running, if not, is it even installed?

Sorry for the late reply @HJLebbink. I wasn't able to check this, but I installed .NET 7 Desktop Runtime like @Sudsey. The error no longer pops up, and some features like code folding and register highlighting even work now - but like @Sudsey, code completion doesn't work.

Initially, after install .NET 7, everything but the code completion and register highlighting didn't work. I changed Assembly Flavour to "Auto Detect" from Intel MASM, and the register highlighting works now. But as previously mentioned, code completion does not.

@ghost
Copy link

ghost commented Apr 7, 2024

I installed .NET 9 Desktop and still getting the LSP failure. The MASM highlighting is working if I select both choices to MASM since I am writing that code x86-64.

** Is there a way to turn off the LSP so I just get the syntax highlight (for MASM)?? **

If you know how to turn off the constant LSP failure pop ups I would like to know that, thanks!

@vault-thirteen
Copy link

I am having a similar issue. The text is a bit different but it is also about LSP.

ASM-Dude

Windows 10 22H2 19045.4412.
Visual Studio Community 2022 17.9.7.
AsmDude2 2.0.1.0.

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

No branches or pull requests