-
Notifications
You must be signed in to change notification settings - Fork 676
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
Debugger Fails to start when attempting to debug test #1428
Comments
@fedoranimus can you look in the debug console during the first launch, and see if you get a message like:
If so, what is your complete message? |
I finally tracked down what caused me to encounter this (as mentioned in the previous issue). Possibly somewhat of a different (but maybe related?) issue. In my <PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
</PropertyGroup> Trying to to
I consider this "user error" though (after doing a bit of research) so I switch back the TargetFramework to So seems like there's some issue about which build output the extension is using when launching the debugger from the GUI? Again, that's probably different than the core issue going on here - let me know if I should open a separate issue for that. |
@gregg-miskelly I do not see that line in the Debug Console, I just see a long list of However, I do get a VSCode error sometimes as well: |
@fedoranimus RE: 'Debug adapter process has terminated' - by chance do you have repo steps? If you can enable logging that might allow us to track down what is going on. Unfortunately you will need the 'full' method for unit test debugging scenarios. |
I should also say - the 'Skipped loading symbols' messages are normal. |
@gregg-miskelly Yup, I expect the 'skipped loading symbols' messages. I'll enable logging and see what comes up - thanks. |
I'm seeing the same problem with xunit tests. Clicking run test works, debug test doesn't... it either dies quietly, or throws up "Failed to start debugger: null". The same project works perfectly in VS 2017 though. Turning on engineLogging as outlined here does not create a log file when using the codelense links, nor is any error shown in any of the output windows. In this case, this is a .net core 1.1 class library project with an xunit test project. The csproj settings are identical to the ones in the initial description above. |
I can echo what @StephenRedd says. I do not see a log file created and the Debug Console doesn't display any warnings or errors. My reproduction steps are that I open VSCode, navigate to a test class and press the "Debug Test" codelens link. The first time the debugger will start but not hit anything. All subsequent times I'll get the Is there anything else I can do to provide additional information? |
Could you provide your OmniSharp Log? |
Where is that located? |
Sorry, forgot to mention it. In VS Code, select View->Output. Then, choose "OmniSharp Log" from the combobox in the top-right corner of the Output pane. |
I noticed one line in it that may be interesting: |
Any chance you could share your project? |
I cannot, sadly. |
You can fork the NullMailer repo to reproduce
Attached is the omnisharp log when I do the exact steps listed. In this case, the debugger just didn't start, but it did not give the pop-up error... when this happens there is no indication if anything is happening outside of the output windows. |
Can I borrow your computer for a few weeks while we work on our other projects having this problem? I have two systems where this doesn't work, but I'll verify by going to one of our servers where none of this is installed --then installing fresh VS Code, the dotnet SDK, and clone this repo to see how it behaves in a vanilla environment. It is sorta re-assuring that it does work somewhere. |
Could you share your OmniSharp Log from one of those systems? Just open the project, wait for OmniSharp to finish loading (i.e. the "run/debug test" adornments appear) and click "debug test". Provide the log after the error appears. |
I attached the log for one in the above comment, but I'll get some more logs for you from the other systems and projects too. |
Sorry, I missed that. It doesn't look it hit the failure in your log. Out of curiosity, have you tried waiting a bit longer? There are a couple of things that happen under the hood (for which there's no currently UI feedback) which might take awhile before the debugger spins up. Most importantly, it builds the project, which might take awhile. |
If it's still spinning up the debug session and you click the "debug test" annotation again (#1421), it would explain why you get that error. |
I'll test waiting a while before trying to launch the test as well and capture the log, but generally speaking I have waited a while. If you take that log above, wait on the same system for 5 minutes, then click debug again here is what the next messages will look like:
|
Yeah, so something's failing before the debug session kicks off. 5 minutes is a pretty long time. I'm going to planning to push out the first beta of our 1.10 release later today, which should have more reporting during that time when you're just waiting. Hopefully that will reveal something. |
I'm seeing the same issue as @StephenRedd when I debug a second time. This occurs only a couple seconds after I click the CodeLens link.
|
OK. Yeah, I expected that you're both seeing this on the second click. The problem is figuring out what happened between the first and second click that caused the debugger not to spin up. |
@DustinCampbell I can't help but notice that you've been buzy, and there's a LOT of new code in both this and the roslyn projects... I have to wonder if you fixed it by accident with some of that new stuff? Anyway, you drop a new vsix for 1.10.0 and I'll be happy to test it out :) In the meantime, I'll run a few more tests and let you know how it goes. |
I don't think I fixed it by accident, but I'd be happy if that were the case. 😄 |
Unfortunately, the project you provided doesn't build. It has the following error:
That said, it doesn't look like this project is set up to work 'dotnet test' as the |
That's very odd - builds on my system and I have no pending changes. I'll have to dig into that. (I assume you did a dotnet restore) Oh, I see. I'm able to call |
Trying a little harder got it building. 😄 |
OK. I can repro. |
FWIW, the problem with building may be related to me having a different .NET Core SDK installed. |
OK. So, here's what I'm seeing. Please let me know if this is similar to what you see:
Next I tried the following:
IOW, what I'm seeing is that the Do you see similar behavior? |
Similar, but not identical. Whenever I open the project, it asks me to restore (not sure why, it's super annoying). If I don't restore, I still won't hit breakpoints, but it will try to load the debugger at least. |
I see why the restore prompt is happening. It's because OmniSharp has a case-sensitive match between the package reference and the package dependency. In test.csproj, try changing "Microsoft.testplatform.testhost" to "Microsoft.TestPlatform.TestHost". |
I'm still getting the same "Debug adapter process has terminated unexpectedly" message, but at least it doesn't try to restore each load! So thanks for that. |
Here's the fix for that package restore issue: OmniSharp/omnisharp-roslyn#861. |
@fedoranimus the "Debug adapter process has terminated unexpectedly" is going to be something different. Can you try installing the 1.10-beta2 release (instructions), setting the "csharp.unitTestDebugingOptions" option (in Preferences->Options) to have debugger logging enabled, and then tell me the last bit of what you see in the debug console? |
@fedoranimus actually, before you do that, is there anything in crashreporter for vsdbg-ui? |
I am seeing crash reports for vsdbg-ui now.
Edit: Have not yet updated to 1.10-beta2 |
Updated to 1.10-beta2. I'm still seeing the same issues. Here is my vsdbg-ui.log |
@fedoranimus can you send me a bit more of the crash report? |
@gregg-miskelly: I can repro this issue on my Mac. I did the following:
Shortly after the debugger starts up, I got the "Debug adapter process has terminated unexpectedly" message. |
Here's the crash log. It looks similar to the heap corruption bug you already looked at. |
Sorry if this is obvious, but I wrote up some instructions: https://github.com/OmniSharp/omnisharp-vscode/wiki/Diagnosting-%22Debug-adapter-process-has-terminated-unexpectedly%22 [EDIT]: please disregard since Dustin provided the crash report, and anyway the repro project reproduced the crash for Dustin anyway. |
@DustinCampbell Thanks! Sorry, I thought you couldn't repro the crash Dustin. |
It works great on Windows, but I hadn't tried it on my Mac yet. |
Yup, this is a dupe of #1456. Looks like whatever has embedded symbols isn't in your project. I can build privates so you can work around. But unfortunately our lab infrastructure is all down right now. So I am not sure how long that will take. |
Okay, thank you. Sorry, I was away from my system all day. |
It's OK. Thank you for providing that simple project to help us repro. Hopefully we'll be able to get you some private bits to try. |
@fedoranimus: I'm curious to know if the latest update (1.10) fixed the issue for you. |
Yes, it does, thank you! |
Excellent! Thanks for confirming. It took a bit to get to the bottom of it, but I think this issue is now fixed. |
Environment data
dotnet --info
output:VS Code version:
1.11.2 & 1.12.0
C# Extension version:
1.9.0
The following lines are in my
.csproj
files as well:Steps to reproduce
Expected behavior
The debugger launches, PDBs are loaded, and VSCode hits a breakpoint.
Actual behavior
The first time, the debugger loads, but no PDBs are loaded so VSCode never hits a breakpoint.
The second time, the debugger fails to load and VSCode presents the message: "Failed to start debugger: null"
The text was updated successfully, but these errors were encountered: