Visual Studio + Chrome debugging startup failure (exit code 6)

342 views
Skip to first unread message

Pierre-Alexandre

unread,
Nov 10, 2015, 4:26:59 PM11/10/15
to Chromium-dev
Hello chromium-dev,

Is anyone else having problems debugging with VS today? Building is fine, but chrome seemingly fails to start when I start debugging:

* Running the debug build normally (out\Debug\chrome.exe) works fine.
* Start Debugging from VS, while Chromium is already opened, opens a new Chromium window then debugging stops (claiming chrome exited with code 6). If I use --single-process, no new window is opened.
* Debugging worked yesterday. Since then, I've done git rebase-update, gclient sync and gclient runhooks twice (I had rebase-update'd to a broken version the first time).
* My latest rebase-update brought me to branch position #358864
* The issue happens in my two branches.
* chrome://conflicts shows "No conflicts detected"
* I tried restarting my computer.
* I tried removing all breakpoints
* I tried a release build instead of a debug build.

I'm not sure what to try next. Suggestions are welcome.

'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\chrome.exe'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\chrome_elf.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\crcrypto.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\base.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wintrust.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\msvcp120d.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\msvcr120d.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\src\chrome\src\out\Debug\boringssl.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\netapi32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\netutils.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\srvcli.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wkscli.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nsi.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Symbols loaded.
'chrome.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Symbols loaded.
The program '[5252] chrome' has exited with code 6 (0x6).

Peter Kasting

unread,
Nov 10, 2015, 4:31:25 PM11/10/15
to prob...@chromium.org, Chromium-dev
On Tue, Nov 10, 2015 at 1:26 PM, Pierre-Alexandre <prob...@chromium.org> wrote:
Hello chromium-dev,

Is anyone else having problems debugging with VS today? Building is fine, but chrome seemingly fails to start when I start debugging:

* Running the debug build normally (out\Debug\chrome.exe) works fine.
* Start Debugging from VS, while Chromium is already opened, opens a new Chromium window then debugging stops (claiming chrome exited with code 6). If I use --single-process, no new window is opened.

I started seeing this problem late last week.  Running Chrome from the command line and then attaching works as a workaround.

I don't know what causes this either, but it would be good to file a bug and start bisecting to find the culprit, especially with this being Windows fixit week.

PK

Scott Graham

unread,
Nov 10, 2015, 5:01:40 PM11/10/15
to Peter Kasting, prob...@chromium.org, Chromium-dev
Can you step into even wWinMain in chrome.exe? Or the CRT initialization? INVALID_HANDLE could be a lot of things, but since you're getting at least some of the components loaded, maybe you can step through and see when it aborts.

(fwiw, it's working OK for me. I'm running on Win10, building with 2013, and debugging in 2015, component=shared_library branding=Chrome.)

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Peter Kasting

unread,
Nov 10, 2015, 5:04:14 PM11/10/15
to Scott Graham, prob...@chromium.org, Chromium-dev
On Tue, Nov 10, 2015 at 2:00 PM, Scott Graham <sco...@chromium.org> wrote:
Can you step into even wWinMain in chrome.exe? Or the CRT initialization? INVALID_HANDLE could be a lot of things, but since you're getting at least some of the components loaded, maybe you can step through and see when it aborts.

I confirmed last week that "Step into" at least steps into the program.  (I forget where, probably WinMain(); whatever it does by default.)  Then hitting "continue" after than still gives exit code 6.
 
(fwiw, it's working OK for me. I'm running on Win10, building with 2013, and debugging in 2015, component=shared_library branding=Chrome.)

I build and debug with VS 2013 on Win 10, component=shared_library, but no branding.

Also this is on a home machine, which may mean I'm not using the hermetic toolchain.  I wonder if that's part of the issue.

PK 

Pierre-Alexandre

unread,
Nov 11, 2015, 10:51:55 AM11/11/15
to Chromium-dev, sco...@chromium.org, prob...@chromium.org
Filed https://code.google.com/p/chromium/issues/detail?id=554514

For completeness:
I'm on VS2013, Win8 on my work machine.

On Tuesday, November 10, 2015 at 5:04:14 PM UTC-5, Peter Kasting wrote:

Bruce

unread,
Nov 12, 2015, 1:13:50 PM11/12/15
to Chromium-dev, sco...@chromium.org, prob...@chromium.org
I'm building 64-bit Chrome with VC++ 2015 (not recommended, yet) and I cannot repro this problem. Debugging with VS 2013 and VS 2015 both work. I synced to the latest code yesterday afternoon.

Does procmon give any hint as to where the INVALID_HANDLE could be coming from? Failing that the best bet is probably to step in and narrow down where the problem happens.

Are you seeing any interesting messages in the debugger output Window? When debugging under VS 2013 (64-bit Chrome) I see this:

First-chance exception at 0x00007FFC36EB871C (KernelBase.dll) in chrome.exe: 0x000006A6: The binding handle is invalid.

When I enabled breaking on throwing of exceptions I halted here:

  KernelBase.dll!RaiseException () Unknown
  rpcrt4.dll!RpcpRaiseException () Unknown
  rpcrt4.dll!RpcRaiseException () Unknown
  rpcrt4.dll!NdrpClientCall3 () Unknown
  rpcrt4.dll!NdrClientCall3 () Unknown
  wlanapi.dll!WlanOpenHandle() Unknown
> chrome.dll!net::`anonymous namespace'::GetConnectionAttributes() Line 64 C++
  chrome.dll!net::GetWifiPHYLayerProtocol() Line 256 C++
  chrome.dll!base::internal::ReturnAsParamAdapter<unsigned long>(const base::Callback<unsigned long __cdecl(void)> & func, unsigned long * result) Line 23 C++
  chrome.dll!base::`anonymous namespace'::PostTaskAndReplyRelay::Run() Line 44 C++
  chrome.dll!base::SequencedWorkerPool::Inner::ThreadLoop(base::SequencedWorkerPool::Worker * this_worker) Line 805 C++
  chrome.dll!base::SequencedWorkerPool::Worker::Run() Line 529 C++
  chrome.dll!base::SimpleThread::ThreadMain() Line 67 C++
  chrome.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 84 C++
  kernel32.dll!BaseThreadInitThunk () Unknown
  ntdll.dll!RtlUserThreadStart () Unknown

This doesn't actually match your symptoms, (it's an invalid handle but the exception code is different), but maybe different drivers causes this to fail differently for you. It seems odd that Chrome is querying Wifi attributes on my desktop machine.

Pierre-Alexandre

unread,
Nov 12, 2015, 1:18:00 PM11/12/15
to Chromium-dev, sco...@chromium.org, prob...@chromium.org
Hi Bruce,

I don't think we're running into the same issue; I couldn't get chrome.dll loaded at all.

I did some more digging and added the following to the bug:
I'm hitting the PLOG in main_dll_loader_win.cc (Failed to load Chrome DLL from -		"C:\\src\\chrome\\src\\chrome\\..\\out\\Debug\\48.0.2562.0\\chrome.dll")

In GetModulePath, it seems like it first tries to see if "C:\\src\\chrome\\src\\chrome\\..\\out\\Debug\\chrome.dll" is open for reading (which fails despite chrome.dll being present in that folder) then falls back to adding the version. 

When running `devenv.exe /debugexe out\Debug\chrome.exe` (which does work) instead, there's no \\..\\ in the path:
"c:\\src\\chrome\\src\\out\\debug\\chrome.dll"

It looks like ::GetModuleFileNameW is returning a different value depending on the VS setup and that base::File, according to its documentation, "fails with access denied if the |path| contains path traversal '..' component.

https://codereview.chromium.org/1402353011 was submitted 9 days ago and is responsible for this issue.

@fdoray is fixing the issue here: https://codereview.chromium.org/1436103005/

Bruce Dawson

unread,
Nov 12, 2015, 1:22:31 PM11/12/15
to prob...@chromium.org, Chromium-dev, Scott Graham
Ah - that explains why I'm not hitting it. I was launching with "devenv /debugexe chrome.exe ..." with no "..\" separators.

Coincidentally I solved the same problem for running msiexec.exe just two days ago.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to a topic in the Google Groups "Chromium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-dev/fOP7RMtIRps/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-dev...@chromium.org.

Reply all
Reply to author
Forward
0 new messages