-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Linux arm 5.0 launch fails with CORDBG_E_MISSING_DEBUGGER_EXPORTS #44745
Comments
Tagging subscribers to this area: @tommcdon Issue Details
|
should this be considered for servicing fix? I'm hearing users not wanting to move to 5.0 because of this |
+1, would be great to see it fixed, debugging is one of the key value of .NET on devices like Raspberry Pi running Linux arm based OS. |
@krwq Do you know if this is just arm linux customers? I was looking at it this past week, but had to prioritize other work. I'll continue this week then. |
From my experience, it is just Linux ARM. Even Linux ARM64 works fine. |
I also encountered this problem. In fact, it's a bit annoying because after the update it turns out that the best solution is to stay with the old version. |
@hoyosjs just a quick idea. Since it is ARM only, I wonder if it could be yet another case of the address conversion issue that we've hit in the past. I can see that all cases that can fail with that error call GetDacTableAddress that ends up calling TryGetSymbol in the elfreader.cpp with m_globalBase passed as the base address parameter. That variable is set here: runtime/src/coreclr/src/debug/daccess/daccess.cpp Line 5594 in e8c4f22
I wonder if the problem could be caused by the TO_TADDR being used to do that conversion. |
Or the base being already incorrectly sign extended. |
I haven't forgotten this. I just can't seem to repro this. All my remote attaches have been working on a RPi running Raspbian 10. |
We're seeing the same issue with our Visual Studio Raspberry Debugger extension. We're seeing the same error: 0x80131c4f It should be pretty quick for you to install and configure the extension because it handles installing the .NET SDK and vsdbg on the Raspberry and also configures the SSH key pair for you. Here's our repo and getting started instructions: https://github.com/nforgeio/RaspberryDebugger It would be really nice to get this working. |
I just tested this again and I am able to attach on 5.0 with no issues on both a RPi 2 and RPi 3 running raspbian 10. However, given this many reports of things failing, there's definitely something that's not working. I copied the programs from the original issue. The files I used in VS Code for the attach are: launch.json{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch REMOTE",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "BuildPublishCopyLinuxARM",
"program": "/home/pi/juhoyosa/opt/RPiDemo/RPiDemo",
"args": [],
"cwd": "/home/pi/juhoyosa/opt/RPiDemo",
"stopAtEntry": true,
"console": "internalConsole",
"justMyCode": false,
"pipeTransport": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "ssh.exe",
"pipeArgs": [
"-T",
"pi@diag-pi3"
],
"quoteArgs": true,
"debuggerPath": "/home/pi/vsdbg/vsdbg"
},
"logging": {
"engineLogging": true,
"programOutput": true,
"exceptions": true
}
},
]
} tasks.json{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "PublishForRPi",
"command": "dotnet",
"type": "shell",
"args": [
"publish",
"-c", "Release",
"-r", "linux-arm",
"-o", "./publish/linux-arm",
"${workspaceFolder}"
],
"group": "build",
"problemMatcher": "$msCompile"
},
{
"label": "Deploy",
"type": "shell",
"command": "scp.exe",
"args": [
"-rp",
"./publish/linux-arm/",
"pi@diag-pi3:/home/pi/juhoyosa/opt/RPiDemo",
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "BuildPublishCopyLinuxARM",
"dependsOrder": "sequence",
"dependsOn": ["PublishForRPi", "Deploy"]
}
]
} @gregg-miskelly one thing I did notice is that I have to use |
You need to disable justMyCode because you used release configuration. Publish debug instead for better results (though no idea if that will help making the problem reproduce). |
@profix898 looking more closely at your launch.json, are these guesses correct?
Is that correct? |
@gregg-miskelly the original post you shared indicated this was a self-contained publish that gets deployed. I had also tried with a fx dependent one, and it worked too. Is it possible that the deployed debugger bits are stale? Or does this one also auto-update? I know if does update under the VS extension, but I don't know what happens when deployed like this. Even with this, I can't think of a recent change in dbgshim that would cause this. |
@hoyosjs the fact that it works for some people and doesn't work for others might really indicate that it is the address conversion issue I've mentioned above. Maybe that on your device, libcoreclr.so is located at a VA < 0x80000000 while on the failing ones it is >= 0x80000000. |
@janvorli i did consider your comments, sorry. At a quick look i didn't see anything particularly obvious. I can't recall if 5.0 is when we made ensured PIE/PIC on Linux arm. If I can't force to load at a higher address later (need to research it there's some way to achieve this), I'll probably instrument the runtime and request for someone to help here. |
I'll give it a try on my local device where I have hit the address related issues in the past. |
I did not check if ASLR is disabled OS-wide, though I'd be surprised. I tested this without a native debugger attached. Thanks for checking this @janvorli |
@hoyosjs The log that profix898 posted indicates that he is using vsdbg 16.8.11013.1, which is the current shipping version. |
@hoyosjs profix898's launch.json has |
I've tried locally to debug a test app on Linux arm32 using lldb + SOS. I would expect the same problem to occur, as it loads mscordaccore and accesses libcoreclr symbols. In my case, all code was at addresses >= 0x80000000 including libcoreclr.so, so it seems to invalidate my theory. |
I will try the original repro steps on my Odroid XU4 ARM32 device and see if I can repro the issue. |
Sorry, but there's no work around. This is a compile time issue. It's been there for years. The problem is we added a new code path and it hits it very easily on such systems. The change is simple but I've had trouble testing this. I've prepared the PR and the port to 5.0 so I can expedite the process. |
Happy to help test if it's not too involved since I'm running the affected hardware. |
This has been merged both into master and 5.0. It will be available in the next release. |
Thanks @bjorg. I was doing manual testing, I wanted to load some tests I can't share but was hitting some issues with the loader being unable to find the right libdl, and couldn't find a combination of LD_LIBRARY_PATH and LD_DEBUG that worked or gave me enough info as to why things failed to load. I used the manual testing as enough proof for now and will investigate doing a more comprehensive testing pass. |
@hoyosjs is this already in the daily installer? Or is there a daily that we can use to test? |
It's not going to be officially released at least until next month. There might be a build which you could use to test things out. How do you build/deploy your app? A shared framework deployment (where the runtime is installed for all apps in the machine)? A self contained app deployment (dotnet publish with a specific runtime identifier)? @microhobby |
For debugging we usually run with the shared framework @hoyosjs |
Let me ask if I can share a nightly build of the rolling release and answer tomorrow. |
There's this https://dotnetcli.blob.core.windows.net/dotnet/Runtime/5.0.2-servicing.20611.21/dotnet-runtime-5.0.2-linux-arm.tar.gz. You can extract it and you'll have a shared framework. On the debugger side, you can set the environment variable |
@hoyosjs ok, got it, thanks |
@hoyosjs I try to debug with the framework that you shared but I'm having the same issue:
Return from
|
@microhobby let me test that particular build. |
hmm @microhobby I just tried attaching to my repro with the provided sample and I am able to attach using a shared framework. If you add this to your csproj (I assume it's a console-like app), does it still run?
|
@hoyosjs I added the snippet on the |
@hoyosjs it's working! I put the |
This issue is from dotnet/vscode-csharp#4210. Bug report is from @profix898
Issue Description
After deploying a .NET 5 linux-arm app to a Raspberry Pi 4, debugging fails with CORDBG_E_MISSING_DEBUGGER_EXPORTS (0x80131c4f). This doesn't happen with 3.1.
Steps to Reproduce
RPiDemo.csproj
Program.cs
The project is successfully compiled in VS Code on Win 10 x64 using the locally installed .NET 5 SDK. The project is published for 'linux-arm' and copied to the Raspberry Pi 4 (with Raspian 10, latest version as of today) with the following command:
dotnet publish -c Release -r linux-arm -o ./publish/linux-arm ${workspaceFolder} ; scp -rp -P 2222 ./publish/linux-arm/ root@192.168.81.129:/opt/RPiDemo
I'm essentially following the instructions at https://github.com/OmniSharp/omnisharp-vscode/wiki/Remote-Debugging-On-Linux-Arm (or similar tutorials on the internet).
The project is then launched on the RPi with the 'vsdbg' remote debugger. My launch.json looks like this:
Expected Behavior
Debugger should launch and attach to the process on the RPi and provide debug information to VS Code.
Actual Behavior
Debugger prints the following error message:
Unable to attach to CoreCLR. Unknown Error: 0x80131c4f
.I have then enabled logging via
"engineLogging": true,
to obtain more details (as shown in the log below).I'd like to note, that the console project works perfectly both locally on the Win 10 x64 host and also when being launched manually on the RPi via the
dotnet RPiDemo.dll
command (directly in the published directory '/opt/RPiDemo').The text was updated successfully, but these errors were encountered: