asm-dude icon indicating copy to clipboard operation
asm-dude copied to clipboard

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

Open HJLebbink opened this issue 1 year ago • 25 comments

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 avatar Sep 30 '23 17:09 HJLebbink

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.<ActivateAsync>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

ElDuderinoBerlin avatar Oct 02 '23 01:10 ElDuderinoBerlin

Exactly the same for me.

LeonsCodeLab avatar Jan 08 '24 19:01 LeonsCodeLab

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...

HJLebbink avatar Jan 08 '24 21:01 HJLebbink

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 ..

MickeyNT avatar Jan 08 '24 23:01 MickeyNT

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.

HJLebbink avatar Jan 09 '24 20:01 HJLebbink

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 https://github.com/HJLebbink/asm-dude/commit/2b897a0fac8afda4f27f5612bc228e5a3e43d41

Regards from Stuttgart

MickeyNT avatar Feb 11 '24 15:02 MickeyNT

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

HJLebbink avatar Feb 11 '24 15:02 HJLebbink

@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

HJLebbink avatar Feb 11 '24 22:02 HJLebbink

It works! asm_dude_win_10_fixed

Nespelem-3000 avatar Feb 16 '24 21:02 Nespelem-3000

It works!

That is good news! TY for the update.

HJLebbink avatar Feb 17 '24 19:02 HJLebbink

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

lstrsrt avatar Feb 21 '24 22:02 lstrsrt

@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.

HJLebbink avatar Feb 22 '24 12:02 HJLebbink

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

Kule02 avatar Feb 28 '24 15:02 Kule02

@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.

bastiel avatar Feb 29 '24 01:02 bastiel

@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 avatar Feb 29 '24 08:02 HJLebbink

@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..."

HJLebbink avatar Feb 29 '24 08:02 HJLebbink

@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

Kule02 avatar Feb 29 '24 12:02 Kule02

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....

MickeyNT avatar Feb 29 '24 19:02 MickeyNT

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.

Sudsey avatar Mar 09 '24 06:03 Sudsey

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.

Yogurt4 avatar Mar 20 '24 15:03 Yogurt4

@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.

bastiel avatar Mar 28 '24 00:03 bastiel

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!

ghost avatar Apr 07 '24 05:04 ghost

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.

vault-thirteen avatar May 16 '24 21:05 vault-thirteen