Vscode-cpptools: Debug adapter process has terminated unexpectedly on Raspberry pi

Created on 24 Aug 2016  路  23Comments  路  Source: microsoft/vscode-cpptools

_From @mong87suk on August 24, 2016 0:47_

  • VSCode Version: 1.5.0
  • OS Version: Raspbian GNU/Linux 8.0 (jessie)

Steps to Reproduce:

I installed visual studio code on raspberry pi.

pi@KERNEL_BZ:~ $ uname -a
Linux KERNEL_BZ 4.4.13-v7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux

This is raspberry pi's information.

This is installation process

  1. git clone https://github.com/mirosoft/vscode
  2. cd vscode
  3. ./scripts/npm.sh intall --arch=armhf
  4. ./scripts/code.sh
  5. Edit on product.json
    adding following to product.jsson
 "extensionsGallery": {
   "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
   "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
   "itemUrl": "https://marketplace.visualstudio.com/items"
   }

After I installed the visual studio code on raspberry pi.
I've tried to debug by using cpp tools.
But Debug adapter process has terminated unexpectedly.
I don't why this error happend.
Could you explain why this error happend?
I really want to solve this problem.
Thank you.

Best regards,
Felinus jeong

Conflict detected, command workbench.action.navigateForward cannot be triggered by ctrl+shift+- due to workbench.action.zoomOut
[Extension Host] debugger listening on port 5870
[Extension Host] TypeError: Cannot read property 'forEach' of null
at LanguageClient.cleanUp (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/lib/main.js:471:24)
at LanguageClient.stop (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/lib/main.js:454:14)
at LanguageClient.handleConnectionError (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/lib/main.js:684:18)
at LanguageClient.createConnection.errorHandler (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/lib/main.js:559:19)
at /home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/lib/main.js:45:42
at CallbackList.invoke (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/events.js:103:39)
at Emitter.fire (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/events.js:167:36)
at writeErrorHandler (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/main.js:78:22)
at CallbackList.invoke (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/events.js:103:39)
at Emitter.fire (/home/pi/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.8.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/events.js:167:36)
Conflict detected, command workbench.action.navigateForward cannot be triggered by ctrl+shift+- due to workbench.action.zoomOut
Error: read ECONNRESET
at exports._errnoException (util.js:890:11)
at Pipe.onread (net.js:552:26)
Debug adapter process has terminated unexpectedly
Debug adapter process has terminated unexpectedly: Error: Debug adapter process has terminated unexpectedly
at Object.create (file:////home/pi/Development/vscode/out/vs/base/common/errors.js:317:22)
at file:////home/pi/Development/vscode/out/vs/workbench/parts/debug/electron-browser/debugService.js:558:67
at Object.notifyError as _notify
at Object.state_error_notify.enter (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:901:30)
at _Base.Class.define._run (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:1068:29)
at _Base.Class.define._chainedError (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:1031:18)
at error (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:736:33)
at ErrorPromise_ctor.ErrorPromise_then as then
at Object.state_waiting.enter (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:747:28)
at _Base.Class.define._run (file:////home/pi/Development/vscode/out/vs/base/common/winjs.base.raw.js:1068:29)

lunch.json

{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/test_led",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb"
}
},
{
"name": "C++ Attach",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x64",
"program": "${workspaceRoot}/test_led",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"processId": "${command.pickProcess}",
"externalConsole": false,
"linux": {
"MIMode": "gdb"
},
"osx": {
"MIMode": "lldb"
},
"windows": {
"MIMode": "gdb"
}
}
]
}

_Copied from original issue: Microsoft/vscode#10866_

debugger

Most helpful comment

The new version works.
For others with the same problem, this is the link for a mono.linux that worked for me with code-oss Version 1.29.0 on my Pi:

http://download.mono-project.com/repo/debian/pool/main/m/mono/mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb

You wget that file then do the same steps as above:

mkdir ~/mono_temp
dpkg -x mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb ~/mono_temp
cp ~/mono_temp/usr/bin/mono-sgen ~/.vscode-oss/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/mono.linux

All 23 comments

The cpp tools are not part of VS Code but a separate extension. I'll move this issue to the correct repository.

Hello @weinand
I'm filnus Jeong
I don't know who can fix this issue.
Could you assign a person who is the charge of this issue ?

Best regards,
Felinus Jeong

Hi, @mong87suk

The C/C++ for Visual Studio Code extension has no official support for running on ARM platforms like the Raspberry Pi. However, it may work if you manually install Mono on your Pi by following the instructions here: http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives

You'll need to "apt-get install mono-runtime" at least, other packages may be required as well.

Hello, @andrewcrawley

Thank you for your support.
I'll try it.
if I have a question I'll let you know.

Best regards,
Felinus Jeong

Hello, @andrewcrawley
Thank you for your comment.
You ask me to install Mono to fix the bug so I've installed below packages to run Mono.

  1. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
    sudo apt-get update
  2. mono-devel
  3. mono-complete
  4. referenceassemblies-pcl
  5. ca-certificates-mono
  6. mono-xsp4
  7. mono-runtime

reference: Install Mono on Linux

I've run the basic code to verify Mono is working correctly.
reference : Mono Basic
It has run. There is no error.

After installed Mono, I tried to run VS Code. but The same error happened.
I'm sorry to give you this error.

Thank you for your support and your time.
I have a question. Why do I need to install Mono?
Could you check why this error happen again?

Best regards,
Felinus Jeong

@mong87suk - Our debugger has a dependency on Mono to run. For our supported OS versions, we download it for you.

The error you posted above is an error in the language service - @sridmad - Do you support running on Raspbian?

The Linux binaries are built for X64 so I don't expect it to run on Pi.

Hello @sridmad
Thank you for your support.
Could you let me know how to build the linux binaries for Pi ?

Best regards,
Felinus Jeong

Hello @Andrew-MSFT,
Thank you for your support.
I reported my issue : Debug adapter process has terminated unexpectedly on Raspberry pi
@sridmad explain to me that The Linux binaries are built for X64 so I don't expect it to run on Pi.
Architecture of Pi is ARM : armv7l

Could you let me know how to build the linux binaries for ARM?

Best regards,
Felinus Jeong

We will look into releasing for Arm for the next version of the extension.

@sridmad
Thank you for your support.
Please let me know when you release for Arm for the version of the extension.

Best regards,
Felinus Jeong

@sridmad, is this going to be officially on your backlog? If so, we will have to do something as well.
@mong87suk, Raspberry pi is not officially supported right now. We have gotten it to work previously, but after some investigation, the arm copy of mono is no longer working for our debugger. We will put this on the backlog, and talk about priority.

Hi @mong87suk,

I have a workaround to get the debugger working for you. You will need to download the mono runtime located at:
http://download.mono-project.com/repo/debian/pool/main/m/mono/

The file you are looking for is called:
mono-runtime-sgen_4.2.3.4-0xamarin1_armhf.deb

Extract the .deb file to some location and locate the mono-sgen executable.
mkdir ~/mono_temp
dpkg -x mono-runtime-sgen_4.2.3.4-0xamarin1_armhf.deb ~/mono_temp

The file should be under ~/mono_temp/usr/bin

Copy the file to your extension folder as follows. Notice that the file name is renamed to mono.linux:
cp ~/mono_temp/usr/bin/mono-sgen ~/.vscode-oss-dev/extensions/ms-vscode.cpptools-0.9.0/debugAdapters/mono.linux

Your debugging should now work.

Hello @pieandcakes
I've tried to run the debug tool of vs code while referring to the explanation you informed me.
It works well. Thank you for your support.
I have a question.
I want to debug as root.
so I've tried to run vs code following command.
sudo .code.sh
and then I've run debug but Debug adapter process has terminated unexpectedly.
Could you explain how to run debug as root?

Best regards
Felinus Jeong

Notice that when the extension is installed it is installed in the user path. You will probably need to install the extension again after you run VSCode as root and then make the same changes into root's extension folder.

Hello @pieandcakes

It works well.
Thank you for your support.

Best regards
Felinus jeong

my device is dji manifold, ubuntu14.04 armhf, code-oss 1.14.0-1497990172 armhf
the mono-runtime-sgen method works and this is my script

wget http://download.mono-project.com/repo/debian/pool/main/m/mono/mono-runtime-sgen_4.2.3.4-0xamarin1_armhf.deb
mkdir ~/mono_temp
dpkg -x mono-runtime-sgen_4.2.3.4-0xamarin1_armhf.deb ~/mono_temp
cp ~/mono_temp/usr/bin/mono-sgen ~/.vscode-oss/extensions/ms-vscode.cpptools-0.14.0/debugAdapters/mono.linux

I also remove all mono packages and it works too

This solution worked for me for Code-oss Version 1.14.0, but does not appear to work for Code-oss Version 1.29.0

Is there another solution for 1.29.0 ?

@truekinetix What about it doesn't work? Can you elaborate by verifying that the mono you are downloading and running is the one getting run? Also, we have updated mono to use the 5.14.0.177 version.

Thanks for your assistance.

So I think I should instead download the mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb version ?

How can I determine the version of the one getting run by code-oss ?
( I click "Start debugging" in the code-oss IDE and see the "Debug adapter" error pop up, no other messages. )

The new version works.
For others with the same problem, this is the link for a mono.linux that worked for me with code-oss Version 1.29.0 on my Pi:

http://download.mono-project.com/repo/debian/pool/main/m/mono/mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb

You wget that file then do the same steps as above:

mkdir ~/mono_temp
dpkg -x mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb ~/mono_temp
cp ~/mono_temp/usr/bin/mono-sgen ~/.vscode-oss/extensions/ms-vscode.cpptools-0.20.1/debugAdapters/mono.linux

I tried VSCode 1.29.0 and mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb, too. These work well.
But the later mono-runtime-sgen could not work.
mono-runtime-sgen_5.16.0.220-0xamarin3+raspbian9b1_armhf.deb is the latest stable version now, according to mono site ( https://www.mono-project.com/download/stable/#download-lin-raspbian ).
Does VSCode 1.29.0 avail only mono-runtime-sgen_5.14.0.177-0xamarin3+raspbian9b1_armhf.deb?

@gamerror Yes, that is correct. We ship mono framework files that match 5.14.0.177 so you need to use that specific version. Mono requires that their framework binaries and their runtime match.

Was this page helpful?
0 / 5 - 0 ratings