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

Crash: 'Debug adapter process has terminated unexpectedly' on arch and manjaro #1323

Closed
NikkyAI opened this issue Mar 14, 2017 · 30 comments
Closed
Assignees
Milestone

Comments

@NikkyAI
Copy link

NikkyAI commented Mar 14, 2017

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     manjaro
 OS Version:
 OS Platform: Linux
 RID:         ubuntu.16.10-x64
 Base Path:   /opt/dotnet/sdk/1.0.1

VS Code version:

Version 1.10.2
Commit 8076a19fdcab7e1fc1707952d652f0bb6c6db331
Date 2017-03-08T14:00:46.854Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0

C# Extension version:
1.8.0

Steps to reproduce

  • install dotnet, dotnet-cli and dotnet-sdk on archlinux (see additional info for building from aur)
  • install C# extension
  • try to debug anything

Expected behavior

running the debugger

Actual behavior

instant crash when trying to run the debugger

Debug adapter process has terminated unexpectedly
Debug adapter process has terminated unexpectedly

Additional info

Linux railgun 4.9.13-1-rt11-MANJARO #1 SMP PREEMPT RT Wed Mar 1 17:46:29 UTC 2017 x86_64 GNU/Linux

System Info
 OS: Manjaro 17.1-dev Gellivara
 Kernel: x86_64 Linux 4.9.13-1-rt11-MANJARO
 Uptime: 5d 12h 23m
 Packages: 1655
 Shell: zsh 5.3.1
 Resolution: 1920x1080
 DE: XFCE4
 WM: Xfwm4
 WM Theme: Vertex-Maia
 GTK Theme: Vertex-Maia-Square [GTK2]
 Icon Theme: Vertex-Maia
 Font: Cantarell 10
 CPU: Intel Core i5-6200U @ 4x 2.8GHz
 GPU: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)

to make dotnet build on archlinux/manjaro
i remember i had to patch a single line in corefx build because of

ignoring return value of function declared with 'warn_unused_result'
attribute [-Werror,-Wunused-result]
pipe2(waitForChildToExecPipe, O_CLOEXEC);

with

-    pipe2(waitForChildToExecPipe, O_CLOEXEC);
+    if (pipe2(waitForChildToExecPipe, O_CLOEXEC)) { } else { }

i wonder if something similar happens with corclr, because i have seen patch files for that flying around too https://gist.github.com/leafi/9404f79bcd3c64e4d828c0c5e06f056d although the line numbers and commit hashes are different now...

followed the steps on #564 #564 (comment)
to install the debugger for 14.04 as well, did not help
tried installing the 16.10 debugger as well (because dotnet --info suggested that it might be compatible with that.. as expected a "Debug adapter process has terminated unexpectedly"

@baumhoto
Copy link

had the same issue (Archlinux 4.9 Kernel, Dotnet 1.0.1, Vscode 1.10.2, C# Extension 1.8.0), but for me it works after i downloaded the ubuntu 14.04 debugger as suggested above.

@NikkyAI
Copy link
Author

NikkyAI commented Mar 15, 2017

same versions.. although i do not know if mnjaro-rt 4.9 is the same as archlinux 4.9 that it is based on.. but it does not help as i mentioned before
same issue, shows the debug controls for a split second and then opens the error popup

@baumhoto
Copy link

ok. steps i did:

@NikkyAI
Copy link
Author

NikkyAI commented Mar 16, 2017

i did the same and tried with all versions of the debugger for ubuntu

  • 16.04 obviously
  • 14.04 as suggested
  • 16.10 too

same result everwhere
some kind of error log would be nice
PS: by now i think that it might crash because of some other missconfiguration in the build task or launch.json .. but it works on windows

@NikkyAI NikkyAI changed the title Crash: Debug adapter process has terminated unexpectedly on arch and manjaro Crash: 'Debug adapter process has terminated unexpectedly' on arch and manjaro Mar 16, 2017
@starquake
Copy link

starquake commented Mar 17, 2017

I tested on a normal arch installation. Same issue. Also tried 16.04, 14.04 and 16.10 and fedora 24

@starquake
Copy link

starquake commented Mar 17, 2017

Running vsdbg is fine. Running vsdbg-ui responds with:

[starquake@archmonkey .debugger]$ ./vsdbg-ui 
Failed to initialize CoreCLR, HRESULT: 0x80131500

@starquake
Copy link

So apparently the wrong version of icu is expected. ArchLinux has icu 58.

I executed this command in the debugger folder:find *.so -type f | xargs ldd 2> /dev/null | grep not\ found
which gave met the following output:

	liblldb-3.6.so => not found
	libvsdebugeng.so => not found
	libvsbaseservices.so => not found
	libvsbaseservices.so => not found
	libicuuc.so.55 => not found
	libicui18n.so.55 => not found
./System.Net.Http.Native.so: /usr/lib/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ./System.Net.Http.Native.so)

I installed icu55 which can be found in the AUR here: https://aur.archlinux.org/packages/icu55/

Now debugging works again!

@JBildstein
Copy link

I installed icu55

  • with 16.10 same error as before
  • with 16.04:
    • popup says: Error processing 'configurationDone' request. Unknown Error: 0x89720010
    • Output->Extensions prints: Waiting for communication on stdin/stdout...
  • with 14.04 same error as before

dotnet --info:

.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     manjaro
 OS Version:  
 OS Platform: Linux
 RID:         ubuntu.16.10-x64
 Base Path:   /opt/dotnet/sdk/1.0.1

after installing icu55, find *.so -type f | xargs ldd 2> /dev/null | grep not\ found still returns:

./System.Net.Http.Native.so: /usr/lib/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ./System.Net.Http.Native.so)
        liblldb-3.6.so => not found
        libvsdebugeng.so => not found
        libvsbaseservices.so => not found
        libvsbaseservices.so => not found

@starquake
Copy link

16.10 and 14.04 expect other icu versions so that's not going to work.
Maybe remove the ms-vscode.csharp-1.8.0 extension and reinstall it.

"Waiting for communication on stdin/stdout..." Actually sounds like it's working. Did you try restarting visual studio code?

@JBildstein
Copy link

ah yes of course, that makes sense.
tried to reinstall the whole extension but got the same result.
I did restart vs code and also it was closed while I changed the packages.

Tried it again with

  • 14.04 and icu52
  • 16.10 and icu57
    which both result in the same error/result as before with 16.04 (0x89720010)

The problem seems to be attaching to the process. If I do a dotnet run in the console and use ".NET Core Attach" in vs code I get the error.
If I use ".NET Core Launch" I can see two dotnet processes spawn for a short time in the system monitor and then I get the error.
Any idea why that might be? maybe a rights issue?

@rajkumar42
Copy link
Contributor

@JBildstein which version of VSCode are you running?

@JBildstein
Copy link

@rajkumar42 Version 1.10.2 - (8076a19fdcab7e1fc1707952d652f0bb6c6db331)
I installed it from the AUR: visual-studio-code-oss

@rajkumar42
Copy link
Contributor

@JBildstein please install stable or insiders.

@JBildstein
Copy link

@rajkumar42 curios, the version from code.visualstudio.com works (using 16.10/icu57) even though it is the exact same version and commit hash as the one from AUR.
Anyway, glad it works now, thanks for the help!

@NikkyAI
Copy link
Author

NikkyAI commented Mar 22, 2017

isu55 and ubuntu 16.04 works on my manjaro system.. yay

i guess the issue should stay open until this is adressed in the debugger installer though..

@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Mar 23, 2017

@NikkyAI are there things that you think the exception can reasonable do today to fix this?

In the longer term (a few months) .NET Core is making changes that they believe will eliminate this class of issue for .NET Core 2.0.

@NikkyAI
Copy link
Author

NikkyAI commented Mar 23, 2017

@gregg-miskelly could you check which version of icu is available and suggest installing one that matches the debugger ?

@gregg-miskelly
Copy link
Contributor

@NikkyAI what is the right way on arch to see what version of icu is installed?

@starquake
Copy link

starquake commented Mar 23, 2017

Multiple versions of icu can be installed: https://aur.archlinux.org/packages/?O=0&SeB=n&K=icu&outdated=&SB=n&SO=a&PP=50&do_Search=Go
Instead of checking if the package is installed I would rather check if the library is available.

I would check if the needed version is installed using something like:

➜  ~ ldconfig -p | grep libicuuc.so.55
        libicuuc.so.55 (libc6,x86-64) => /usr/lib/libicuuc.so.55

Alternatively you could just check if /usr/lib/libicuuc.so.55 exists

If you want to actually know what version is included in the icu package that is currently installed do this:

pacman -Qi icu | grep "Version" | sed 's/^Version\s*:\s//'

@gregg-miskelly gregg-miskelly added this to the 1.9 milestone Mar 27, 2017
@gegenschall
Copy link

gegenschall commented Apr 3, 2017

In my humble opinion the real solution would be to give the user a setting to configure the .NET Core debugger path manually, I'm thinking something like omnisharp.debuggerPath.

That way it would be possible to create a working version of the debugger by replacing all *.so and *.Native.dll with the ones from the dotnet AUR package and persist these changes across omnisharp updates.

Fumbling with icu/curl/$whatnot versions is time consuming, error prone and just not the right way to do it.

edit: I created an AUR package for the debugger that should work for all Arch based distributions: vscode-coreclr-debug.
Install it, boldly rm -r your ~/.vscode/extensions/ms-vscode.csharp-1.?.?/.debugger directory and then issue a ln -s /opt/dotnet/debugger ~/.vscode/extensions/ms-vscode.csharp-1.?.?/.debugger. Should be working just fine...

@gregg-miskelly gregg-miskelly self-assigned this Apr 4, 2017
@gregg-miskelly
Copy link
Contributor

Here is my tentative plan, let me know if anyone hates this. I haven't finished implementing this yet, so I may change my mind if something doesn't work as well as I am expecting.

  1. Add a new preference to VS Code to select what version of the debugger to use on Linux
  2. Add a new wiki page with the relevant parts of this issue to this repo
  3. Add a new error message when installing on arch that will direct folks to the wiki page

@rajkumar42
Copy link
Contributor

👍
@gregg-miskelly would this selector show up only on arch (unsupported coreclr distros) ?

@gregg-miskelly
Copy link
Contributor

@rajkumar42 my thought is that we would look at the setting on any Linux distro other than the few officially supported ones (ex: Ubuntu16).

gregg-miskelly added a commit to gregg-miskelly/vscode-csharp that referenced this issue Apr 7, 2017
dotnet#1361
dotnet#1323

Changes:
1. Add a setting to control what version of the debugger to use on Linux
2. We no longer automaticially select a debugger on Arch. Instead, we point folks to a web page telling them how to install it.
3. Added logic to the package manager so that it can detect if a package is already installed so it will not be redownloaded. This was needed since I wanted to trigger redownloads in the case that the user added the Linux distro setting. But it seemed like a useful feature anyway for folks on slow internet connections.
4. Moved the install code to its own .ts file
gregg-miskelly added a commit that referenced this issue Apr 7, 2017
* Improve dependancy handling / Linux distro handling

#1361
#1323

Changes:
1. Add a setting to control what version of the debugger to use on Linux
2. We no longer automaticially select a debugger on Arch. Instead, we point folks to a web page telling them how to install it.
3. Added logic to the package manager so that it can detect if a package is already installed so it will not be redownloaded. This was needed since I wanted to trigger redownloads in the case that the user added the Linux distro setting. But it seemed like a useful feature anyway for folks on slow internet connections.
4. Moved the install code to its own .ts file

* Updates to the changelog

* Code review fixes

* Restore original whitespace in package.json

* Remove 'runtime id' from the install log
@rafamerlin
Copy link

rafamerlin commented Apr 9, 2017

@gegenschall I tried your solution but now when I open Vs Code it immediately gives me:

[ERROR]: An error occured while installing the .NET Core Debugger:
Error: Error during installation.

I've also tried to add on /etc/os-release the line

ID_LIKE=arch

And to install icu55.

I'm using Manjaro. Do you know if there is something I'm missing.

Cheers

Edit:

I was able to fix it!
First I've removed the vscode-coreclr-debug package and the extension.
Then I've reinstalled the extension and also installed icu54 (besides the 55), because I saw in another issue someone mentioning that fedora install + icu 54 worked.

Well, I tried the fedora first but it didn't work, so I went back to ubuntu and the ID_LIKE and now it's working fine.

I know here's not the place to ask it, but being a noob, I got that icu are libraries that install a bunch of packages on linux. I just couldn't get how other users were able to find out which icu was missing (55 and 54 for example). Is there any reference I can use to learn the same.

@gegenschall
Copy link

@Merurino Ignore the error and don't install funky icu versions, just use the one from [core] it should be working just fine.

@rafamerlin
Copy link

Hey @gegenschall thanks for the reply.
By core you mean the AUR package you made? It didn't work. Is it dangerous to install icu packages? I got them from AUR and checked the script before installing.

@gegenschall
Copy link

gegenschall commented Apr 10, 2017

@Merurino By [core] I mean the default Arch Linux core repository. No, it's not dangerous to install icu packages but the dotnet dependency of vscode-coreclr-debug is (partially) compiled from the coreclr source code anyway and should correctly link to the latest icu version from the core repository. This means that there shouldn't be any need to "clog" your system with additional icu versions.

But hey: If your method works, then all is good. Whatever works, right? :-)

@starquake
Copy link

@gegenschall Totally missed your edit on the new AUR package. Sounds great! Will try it ASAP.

Thanks!

@gregg-miskelly
Copy link
Contributor

Closing this as it should be fixed in upcoming 1.9.

@gregg-miskelly
Copy link
Contributor

If anyone would like to try the private before 1.9 is out, here are instructions --

  1. Download csharp-1.9.0-beta2-private.zip
  2. Rename the extension from '.zip' to '.vsix'
  3. Follow instructions on https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases for installing it.

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

No branches or pull requests

8 participants