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

debugger hangs, building with LTCG fixes it #484

Closed
seanmiddleditch opened this issue Feb 10, 2017 · 21 comments
Closed

debugger hangs, building with LTCG fixes it #484

seanmiddleditch opened this issue Feb 10, 2017 · 21 comments
Assignees
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available.

Comments

@seanmiddleditch
Copy link

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.

--------------------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Xamarin Studio software to help you develop and test your
applications.
--------------------------------------------------------------------------------
<- (Event) {"seq":2,"type":"event","event":"initialized"}
<- (Response) {"seq":4,"type":"response","request_seq":2,"success":true,"command":"launch"}
-> (Request) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":3}
<- (Response) {"seq":7,"type":"response","request_seq":3,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
-> (Request) {"command":"configurationDone","type":"request","seq":4}
<- (Event) {"seq":10,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/clrdbg/ProcessCreate","data":{}}}
<- (Event) {"seq":12,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/Launch","data":{"VS.Diagnostics.Debugger.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.SourceFileMappings":0,"VS.Diagnostics.Debugger.Launch.Duration":63,"VS.Diagnostics.Debugger.ImplementationName":"vsdbg","VS.Diagnostics.Debugger.AdapterId":"cppvsdbg","VS.Diagnostics.Debugger.EngineVersion":"15.0.26109.1 built by: PREVIEW.DBG1"}}}
<- (Response) {"seq":14,"type":"response","request_seq":4,"success":true,"command":"configurationDone"}
-> (Request) {"command":"threads","type":"request","seq":5}
<- (Response) {"seq":17,"type":"response","request_seq":5,"success":true,"command":"threads","body":{"threads":[]}}
<- (Event) {"seq":19,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\play.exe'. Symbols are loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\play.exe'. Symbols are loaded.
<- (Event) {"seq":21,"type":"event","event":"thread","body":{"reason":"started","threadId":6840}}
-> (Request) {"command":"threads","type":"request","seq":6}
<- (Response) {"seq":24,"type":"response","request_seq":6,"success":true,"command":"threads","body":{"threads":[{"id":6840,"name":"Thread #1"}]}}
<- (Event) {"seq":26,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\ntdll.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\ntdll.dll'. Symbols are not loaded.
<- (Event) {"seq":28,"type":"event","event":"thread","body":{"reason":"started","threadId":17956}}
-> (Request) {"command":"threads","type":"request","seq":7}
<- (Response) {"seq":31,"type":"response","request_seq":7,"success":true,"command":"threads","body":{"threads":[{"id":6840,"name":"Thread #1"},{"id":17956,"name":"Thread #2"}]}}
<- (Event) {"seq":33,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\kernel32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\kernel32.dll'. Symbols are not loaded.
<- (Event) {"seq":35,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\KernelBase.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols are not loaded.
<- (Event) {"seq":37,"type":"event","event":"thread","body":{"reason":"started","threadId":16788}}
-> (Request) {"command":"threads","type":"request","seq":8}
<- (Response) {"seq":40,"type":"response","request_seq":8,"success":true,"command":"threads","body":{"threads":[{"id":6840,"name":"Thread #1"},{"id":17956,"name":"Thread #2"},{"id":16788,"name":"Thread #3"}]}}
<- (Event) {"seq":42,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\demo.dll'. Symbols are loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\demo.dll'. Symbols are loaded.
<- (Event) {"seq":44,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\engine.dll'. Symbols are loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\engine.dll'. Symbols are loaded.
<- (Event) {"seq":46,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\user32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\user32.dll'. Symbols are not loaded.
<- (Event) {"seq":48,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\win32u.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\win32u.dll'. Symbols are not loaded.
<- (Event) {"seq":50,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\gdi32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\gdi32.dll'. Symbols are not loaded.
<- (Event) {"seq":52,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\gdi32full.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\gdi32full.dll'. Symbols are not loaded.
<- (Event) {"seq":54,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\imm32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\imm32.dll'. Symbols are not loaded.
<- (Event) {"seq":56,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\profile.dll'. Symbols are loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\profile.dll'. Symbols are loaded.
<- (Event) {"seq":58,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\ws2_32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\ws2_32.dll'. Symbols are not loaded.
<- (Event) {"seq":60,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\sechost.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\sechost.dll'. Symbols are not loaded.
<- (Event) {"seq":62,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\rpcrt4.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols are not loaded.
<- (Event) {"seq":64,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\vcruntime140d.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\vcruntime140d.dll'. Symbols are not loaded.
<- (Event) {"seq":66,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\ucrtbased.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\ucrtbased.dll'. Symbols are not loaded.
<- (Event) {"seq":68,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\SDL2.dll'. Symbols are not loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\SDL2.dll'. Symbols are not loaded.
<- (Event) {"seq":70,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\advapi32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\advapi32.dll'. Symbols are not loaded.
<- (Event) {"seq":72,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\msvcrt.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols are not loaded.
<- (Event) {"seq":74,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\ole32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\ole32.dll'. Symbols are not loaded.
<- (Event) {"seq":76,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\combase.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\combase.dll'. Symbols are not loaded.
<- (Event) {"seq":78,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\ucrtbase.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\ucrtbase.dll'. Symbols are not loaded.
<- (Event) {"seq":80,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\bcryptprimitives.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\bcryptprimitives.dll'. Symbols are not loaded.
<- (Event) {"seq":82,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\oleaut32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\oleaut32.dll'. Symbols are not loaded.
<- (Event) {"seq":84,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\msvcp_win.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\msvcp_win.dll'. Symbols are not loaded.
<- (Event) {"seq":86,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\shell32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\shell32.dll'. Symbols are not loaded.
<- (Event) {"seq":88,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\cfgmgr32.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\cfgmgr32.dll'. Symbols are not loaded.
<- (Event) {"seq":90,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\windows.storage.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\windows.storage.dll'. Symbols are not loaded.
<- (Event) {"seq":92,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\powrprof.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\powrprof.dll'. Symbols are not loaded.
<- (Event) {"seq":94,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\shlwapi.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\shlwapi.dll'. Symbols are not loaded.
<- (Event) {"seq":96,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\kernel.appcore.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\kernel.appcore.dll'. Symbols are not loaded.
<- (Event) {"seq":98,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\SHCore.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\SHCore.dll'. Symbols are not loaded.
<- (Event) {"seq":100,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\profapi.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\profapi.dll'. Symbols are not loaded.
<- (Event) {"seq":102,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'G:\\Sean\\Documents\\Projects\\game\\output\\bin\\debug64\\SDL2_mixer.dll'. Symbols are not loaded.\n"}}
Loaded 'G:\Sean\Documents\Projects\game\output\bin\debug64\SDL2_mixer.dll'. Symbols are not loaded.
<- (Event) {"seq":104,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\msvcp140d.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\msvcp140d.dll'. Symbols are not loaded.
<- (Event) {"seq":106,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\d3d11.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\d3d11.dll'. Symbols are not loaded.
<- (Event) {"seq":108,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\version.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\version.dll'. Symbols are not loaded.
<- (Event) {"seq":110,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\winmm.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\winmm.dll'. Symbols are not loaded.
<- (Event) {"seq":112,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\dxgi.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\dxgi.dll'. Symbols are not loaded.
<- (Event) {"seq":114,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\winmmbase.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\winmmbase.dll'. Symbols are not loaded.
<- (Event) {"seq":116,"type":"event","event":"thread","body":{"reason":"started","threadId":12428}}
-> (Request) {"command":"threads","type":"request","seq":9}
<- (Response) {"seq":119,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":6840,"name":"Thread #1"},{"id":17956,"name":"Thread #2"},{"id":16788,"name":"Thread #3"},{"id":12428,"name":"Thread #4"}]}}

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:

-> (Request) {"command":"pause","arguments":{"threadId":12428},"type":"request","seq":10}

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:

<- (Event) {"seq":114,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\winmmbase.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\winmmbase.dll'. Symbols are not loaded.
<- (Event) {"seq":116,"type":"event","event":"thread","body":{"reason":"started","threadId":18400}}
-> (Request) {"command":"threads","type":"request","seq":9}
<- (Response) {"seq":119,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[{"id":6128,"name":"Thread #1"},{"id":18856,"name":"Thread #2"},{"id":18876,"name":"Thread #3"},{"id":18400,"name":"Thread #4"}]}}
<- (Event) {"seq":121,"type":"event","event":"output","body":{"category":"console","output":"The thread 18856 has exited with code 0 (0x0).\n"}}
The thread 18856 has exited with code 0 (0x0).
<- (Event) {"seq":123,"type":"event","event":"thread","body":{"reason":"exited","threadId":18856}}
<- (Event) {"seq":125,"type":"event","event":"thread","body":{"reason":"started","threadId":15756}}
-> (Request) {"command":"threads","type":"request","seq":10}
<- (Response) {"seq":128,"type":"response","request_seq":10,"success":true,"command":"threads","body":{"threads":[{"id":6128,"name":"Thread #1"},{"id":18876,"name":"Thread #2"},{"id":18400,"name":"Thread #3"},{"id":15756,"name":"Thread #4"}]}}
<- (Event) {"seq":130,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\mswsock.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\mswsock.dll'. Symbols are not loaded.
<- (Event) {"seq":132,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\uxtheme.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\uxtheme.dll'. Symbols are not loaded.
<- (Event) {"seq":134,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\clbcatq.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\clbcatq.dll'. Symbols are not loaded.
<- (Event) {"seq":136,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\XAudio2_7.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\XAudio2_7.dll'. Symbols are not loaded.
<- (Event) {"seq":138,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\MMDevAPI.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\MMDevAPI.dll'. Symbols are not loaded.
<- (Event) {"seq":140,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\devobj.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\devobj.dll'. Symbols are not loaded.
<- (Event) {"seq":142,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'C:\\Windows\\System32\\propsys.dll'. Symbols are not loaded.\n"}}
Loaded 'C:\Windows\System32\propsys.dll'. Symbols are not loaded.
<- (Event) {"seq":144,"type":"event","event":"thread","body":{"reason":"started","threadId":17500}}
-> (Request) {"command":"threads","type":"request","seq":11}
<- (Response) {"seq":147,"type":"response","request_seq":11,"success":true,"command":"threads","body":{"threads":[{"id":6128,"name":"Thread #1"},{"id":18876,"name":"Thread #2"},{"id":18400,"name":"Thread #3"},{"id":15756,"name":"Thread #4"},{"id":17500,"name":"Thread #5"}]}}

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:

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemDefinitionGroup>
    <ClCompile>
      <WholeProgramOptimization>true</WholeProgramOptimization>
    </ClCompile>
  </ItemDefinitionGroup>
</Project>

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.

@pieandcakes pieandcakes self-assigned this Feb 10, 2017
@pieandcakes
Copy link
Contributor

@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 0.10.1. If you can, try and uninstall and reinstall the extension which should download a new copy of the debugger and see if this issue continues to repro.

@pieandcakes
Copy link
Contributor

Also, would it be possible to save a dump of both msvsmon.exe and clrdbg.exe using Visual Studio and sending that to me?

@seanmiddleditch
Copy link
Author

@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)

@pieandcakes
Copy link
Contributor

pieandcakes commented Feb 10, 2017

@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/

@seanmiddleditch
Copy link
Author

Ah, those kinds of dump files. :) Roger, will get those over when I'm at the workstation.

@seanmiddleditch
Copy link
Author

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.

@seanmiddleditch
Copy link
Author

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

@pieandcakes
Copy link
Contributor

@seanmiddleditch Thanks. I've downloaded it and will take a look as soon as I get a chance.

@pieandcakes
Copy link
Contributor

@seanmiddleditch Looks like an issue with linker changes in Visual Studio 2017 RC and our debugger. Can you try and copy the file from C:\Program Files (x86)\Microsoft Visual Studio\2017\<Version>\Common7\IDE\Remote Debugger\x86\msdia140.dll and replace the one in C:\Users\<username>\.vscode\extensions\ms-vscode.cpptools-0.10.1\debugAdapters\vsdbg\bin and see if it works? I suspect it is the newer FASTLINK changes that were made and we found out that enabling /LTCG disables that new FASTLINK optimization which is probably why it works. We'll probably need an update on that dependency once Visual Studio 2017 RTMs.

@noct
Copy link

noct commented Feb 14, 2017

@pieandcakes

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 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x86\misdia140.dll over the provided appears to fix the issue and the application launches correctly.

@pieandcakes
Copy link
Contributor

@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.

@seanmiddleditch
Copy link
Author

I probably won't be able to get to it until tomorrow evening but I'll try that fix soon as I can.

@seanmiddleditch
Copy link
Author

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 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger directory at all (not sure how to get that; I seem to have all the relevant packages selected in the VS installer) but I found multiple other copies buried in the VS 14.

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.

@pieandcakes
Copy link
Contributor

@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?

@seanmiddleditch
Copy link
Author

@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 msdia140.dll version 14.10.24930.0 from the correct path you provided and can confirm that it does fix the issue. Thank you, and I appreciate your patience with my bumbling. :)

@pieandcakes
Copy link
Contributor

Since VS 2017 RTW has shipped, adding this for vNext

@andyleejordan
Copy link
Member

This appears to still be a problem in the latest version of the extension (I had to go overwrite msdia140.dll again).

@pieandcakes
Copy link
Contributor

pieandcakes commented Jun 5, 2017

@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.

@pieandcakes pieandcakes removed this from the vNext milestone Jun 5, 2017
@pieandcakes
Copy link
Contributor

pieandcakes commented Jul 17, 2017

@seanmiddleditch @andschwa This is fixed in 0.12.1 being released this week.

@andyleejordan
Copy link
Member

Yay! Thank you 😄

@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jul 17, 2017
@focusunsink
Copy link

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".
After all, I use "code --verbose" instead of "code" to start vscode. Then it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug debugger fixed Check the Milestone for the release in which the fix is or will be available.
Projects
None yet
Development

No branches or pull requests

6 participants