-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 hangs, building with LTCG fixes it #484
Comments
@seanmiddleditch Can you tell me which version of VSCode and the extension you are using? There was an issue that was resolved with an update of the Visual C++ Debugger that was released around the time we put out |
Also, would it be possible to save a dump of both |
@pieandcakes - very latest of both (vsvcode 1.9.1 and and cpptools 0.10.1) exhibited the behavior, but I didn't try a full uninstall first - I'll give that a go when I'm back at the workstation. Do you have a handy link to instructions on getting the dump files you asked for? (a quick Google search didn't educate me on the details) |
@seanmiddleditch You would need to Attach to the process as managed and then you can follow these instructions as they should be the same (use the method with Visual Studio): https://blogs.msdn.microsoft.com/debugger/2009/12/30/what-is-a-dump-and-how-do-i-create-one/ |
Ah, those kinds of dump files. :) Roger, will get those over when I'm at the workstation. |
Just tried completely uninstalling the plugin and then code itself, then reinstalling. Debugger still hangs, but the behavior is now slightly different (it now creates two threads after loading winmmbase and then hangs, whereas before it very consistently only created one). Grabbing dumps now. |
The dump files are too big to post on GH even when 7zipped, so they're over at https://dl.dropboxusercontent.com/u/1395243/dumps.7z |
@seanmiddleditch Thanks. I've downloaded it and will take a look as soon as I get a chance. |
@seanmiddleditch Looks like an issue with linker changes in Visual Studio 2017 RC and our debugger. Can you try and copy the file from |
I have a similar issue to the above, using: VS2015 Update 3, vscode 1.9.1, and cpptools 0.10.1 I've only attempted debugging with Debug x64 binaries, but the result is the hang described above. Your suggestion to copying |
@noct Thanks. We are planning on updating the dependency in our release once Microsoft Visual Studio 2017 RTM goes out. It isn't that it is hanging. We have to break on entry to setup debugging and then continue running, but in this instance its taking it a bit to build the full pdbs in the background. This is also why enabling /LTCG fixes the problem also. |
I probably won't be able to get to it until tomorrow evening but I'll try that fix soon as I can. |
I found a few moments to try it out. Confirmed the fix, though I had to alter the instructions a bit. My machine doesn't have a Interestingly, the one that fixes the problem for me is an older copy (14.00.23026.0) of the DLL than some of the others I found in my install, but the newest version I had (e.g. 14.00.24210.0) did not fix the problem. |
@seanmiddleditch The instructions I left were to use the one from your Visual Studio 2017 RC installation. Can you try that one and see if it works also? |
@pieandcakes Whoops, I copied the source path from the other guy's comment and didn't realize it was the 2015 install directory. Copied the |
Since VS 2017 RTW has shipped, adding this for vNext |
This appears to still be a problem in the latest version of the extension (I had to go overwrite |
@andschwa Yes I haven't had a chance to resolve this yet. It isn't a trivial fix that I thought it would be. Its something that i'm still committed to doing and i'll update this once its done. |
@seanmiddleditch @andschwa This is fixed in 0.12.1 being released this week. |
Yay! Thank you 😄 |
I come with a more serious problem. When I use vscode run c++ elf, the program always hangs at the start. Then I can't move forward any step exception canceling "launch". |
I have a project with some peculiar behavior. It builds several executables and DLLs on Win64 in either Release or Debug perfectly. The resulting binaries from either configuration run and execute correctly from either Explorer or from Visual Studio 2017rc. The debugger in VS2017 works correctly with the binaries from either configuration.
With Visual Studio Code and vscode-cpptools, debugging the Release configuration binary works correctly, but debugging the Debug configuration binary always results in an apparent debugger hang. If I launch the Debug binary using launch.json with cppvsdbg, the debugger process eventually hangs (it loads DLLs and communicates for a while) before the application actually starts running.
There is no information error output from
"logging":{"trace":true}
that I can tell - it gets to a point and then everything just stops. The commands from VSCode like Pause or even Stop also stop working.Again, that is the complete output - nothing else ever shows up unless I try something like Pause. The output is very consistent every time I try to launch that particular Debug configuration binary from VSCode: winmmbase.dll loads, a thread start event comes in, VSCode queries the threads, and then the hang. I can then try to Pause and get:
And then nothing else ever shows up, no matter what buttons I hit. No more events, no response to the pause request, nothing. After trying Pause, I hit Disconnect, which hangs and eventually pops up a "canceled" error, and hitting Disconnect twice seems to hard-terminate the debug session with no message.
The output is virtually identical for the Release configuration binary. Truncated bits from a Release debug session starting from event 114 showing what is apparently supposed to happen:
Note that attaching to this Debug configuration process also eventually hangs the debugger. I can attach the debugger to the process and everything works - it even sees all 17 threads - until I hit Pause in VSCode, and then everything hangs the same way. To reiterate, running this binary works flawlessly. Debugging it from VS2017rc works flawlessly. Debugging the Release configuration binary from the project in VSCode works flawlessly. Only debugging the Debug configuration binary fails. I've tested with some other projects and can debug Debug configuration executables fine, just not from this one project.
After experimenting with build options, I found that adding this .props file to the Debug configuration makes it work with VSCode's debugger:
Literally, that's the only change I have to make. Rebuild with that and VSCode can debug the Debug configuration binaries. For whatever reason, enabling LTCG for the debug binary (all other build options being the same) makes everything work. I cannot offhand think of any reason for this to be, especially since VS2017rc can debug that exact same binary with no difficulties at all without LTCG.
Sharing the whole project is not an option, and my attempts to build a simple repro case have failed. I'm mostly at this point looking for hints or instructions on how to gather more useful telemetry to hand over, or how to analyze the problem myself.
The text was updated successfully, but these errors were encountered: