vs-chromium icon indicating copy to clipboard operation
vs-chromium copied to clipboard

Child process debugging causes Chrome to stop working after first run

Open 159oje opened this issue 9 years ago • 4 comments

I'm using VS2013 Professional on Windows 8.1 x64 with VSChromium v0.9.14. I have enabled child process debugging, and am trying to debug a Release build of Chromium. Recent changes to the Chromium codebase mean that this would usually fail due to permissions on the AppContainer preventing the debugger from attaching to renderer processes, so I have made some small local changes to the code base which only removes the AppContainer, but does not disable the sandbox.

Under this setup, I am able to launch Chromium under the debugger with F5, and everything operates perfectly. However, after this first debugging run is finished (whether it is forcefully killed by stopping the debugger or terminated normally by closing all Chromium windows), subsequent runs fail to work. In some cases, the renderer process does not start, resulting in an empty windows, and sometimes the renderer process will start, but hang loading the page. In both cases, breakpoints in the renderer processes are not hit on subsequent runs (when they were being hit in the first run).

In order to rectify this, currently I am having to restart VS each time I want to run Chromium under the debugger, which is very slow. Because of this behavior, it seems to me that there might be some state issues in the child process debugging area of the code for VSChromium, although I'm not familiar enough with C# to be able to track it down.

Is this a problem you have encountered, or are able to reproduce? I'd be happy to share my patch to disable AppContainers if this helps in reproducing this issue.

159oje avatar Apr 27 '15 12:04 159oje

If it helps you track it down, I stumbled across a weird workaround - If you specify the debugger type as "Native Only" (as opposed to the default of "Auto"), things seem to work.

159oje avatar Apr 27 '15 13:04 159oje

Never mind - It's back again :(

159oje avatar Apr 27 '15 13:04 159oje

Can you try using the Child Process Debugging Power Tool? I wrote this part of VsChromium before the Child Process Debugging tool was available, but now that there is an "official" way to do this it seems best to use that. Plus it's written by Microsoft, so it's more likely to work correctly. I had to kind of make up my own way in a sea of under-documented interfaces.

zjturner avatar Apr 27 '15 16:04 zjturner

I had tried that powertool before, but it doesn't see or attach to any of the chrome child processes when using F5, perhaps Chromium is doing something funky and non-standard over the usual CreateProcess() call? I've tried with the default settings (which should be a catch-all by the looks of it) and with specific settings for chrome.exe, neither result in any more than the main browser process being debugged.

159oje avatar Apr 28 '15 12:04 159oje