New issue
Advanced search Search tips

Issue 749946 link

Starred by 4 users

Issue metadata

Status: Available
Merged: issue 667820
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

5 s Chrome hang caused by closesocket, no obvious culprit

Project Member Reported by brucedaw...@chromium.org, Jul 28 2017

Issue description

A comment on my blog complained about a Chrome hang, with new AMD drivers being the suspect:
https://randomascii.wordpress.com/about/#comment-27072

Analysis of the referenced ETW trace (https://mega.nz/#!RtpjSSZT!S4vXTI5b-f7Ss9v8zcOCEO1Ti33IKooElTMyQN-L-30) showed:

Chrome PIDs by process type:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (6012)
    browser     : 6012 
    crashpad-handler : 4872 
    gpu-process : 7204 
    renderer    : 984 2292 2608 6928 7372 7380 7388 7396 7404 7412 7688 9760 12108 12688 13140 13164 
    watcher     : 3056 

UI Delays graph says that chrome.exe (6012) thread 5160 is blocked for 5.11 s (MsgCheckDelay).

CPU Usage (Precise) says that thread was blocked on one context switch for 5.105 s, readied by chrome.exe (6012) thread 7176, which was blocked for 5.278 s on two context switches, on a call to ws2_32.dll!closesocket. It was readied by the system process thread 224 on this call stack:

  ntoskrnl.exe!KiStartSystemThread
  ntoskrnl.exe!PspSystemThreadStartup
  ntoskrnl.exe!ExpWorkerThread
  ntoskrnl.exe!IopProcessWorkItem
  NETIO.SYS!NetiopIoWorkItemRoutine
  tcpip.sys!UdpCleanupEndpointWorkQueueRoutine
  afd.sys!AfdTLCloseEndpointComplete
  ntoskrnl.exe!KeSetEvent
  ntoskrnl.exe!KiExitDispatcher

To be clear, the hang was caused because closesocket() took about five seconds to finish. This has been seen before, but usually with third-party WiFi drivers on the call stacks.

Note that all of the modules on the system process thread were published by Microsoft, and all of the modules on the Chrome threads were published by Chrome and Microsoft, so it is not clear whether this can be blamed on a third-party driver. In fact, it seems to be happening on a wired network (physical network is Killer E2200 Gigabit Ethernet Controller).

Chrome Version: 59.0.3071.115
OS: 10.0.15063.0 (WinBuild.160101.0800)

 
See https://twitter.com/BruceDawson0xB/status/890755061436923904 for initial call for help from AMD, but it's probably not AMD.

Comment 2 by hork...@gmail.com, Jul 28 2017

Tried to roll back to AMD drivers ver 22.19.171.257 from (22.19.662.4) but hitches were still present

I'm on Wired Network

And it's most noticeable on websites with autoplaying videos/gifs a few moments after loading page (or switching to/closing tab)

another ETW
https://mega.nz/#!IhAQEIpK!Fj7GQo6I3myVx6Cvaz-YtGXcWwSbC6O4H3XiblwD8NA

Try opening up Device Manager to see if there are new drivers for your Ethernet controller. Our assumption is that this is a driver bug, but this is the first time I've seen the issue on a wired network.

Comment 4 by apblin...@gmail.com, Jul 28 2017

Tried to unsuccessfully repro it on one of my systems here.
Was there any other change to the system recently? Is ending the ATIECLXX.exe process via Task Manager changing the behavior by any chance? 
Since rolling back to the previous driver didn't resolve it, seems to indicate the problem is likely not on the graphics driver files. 
MOde information needed. 

Comment 5 by apblin...@gmail.com, Jul 28 2017

Looking at the ETW files, there doesn't seem to be an indication any AMD driver component has a substantial presence. And neither would impact network function 
Components: Internals>Network
Other possibly related bugs:

crbug.com/749758 - closesocket hang during shutdown
 crbug.com/739327  - browser hung and unkillable, blocked on closesocket
 crbug.com/667820  - five second hangs in closesocket, believed to be caused by old/unsupported Intel WiFi driver
crbug.com/165382 - Browser IO thread hangs for several seconds (closing UDP socket for async DNS request?)

crbug.com/708204 - Linux version of this? Presumably unrelated, but huh.

Also, when I bought a new laptop a few months ago I would initially have *atrocious* hangs in Chrome when resuming from standby. Updating the WiFi driver resolved those completely.

My assumption remains that this is an OS or, more likely, driver bugs rather than a Chrome bug but it could still be valuable to have instrumentation to assess the extent of the problem.

> My assumption remains that this is an OS or, more likely, driver bugs rather than a Chrome bug but it could still be valuable to have instrumentation to assess the extent of the problem.

I think we already have instrumentation. There is "Net.UDPSocketWinClose" histogram which measures the time closesocket() takes when we are closing a udp socket on Windows. There are about 0.05% of users on Stable who have closesocket() take more than 1s. 

Comment 8 by hork...@gmail.com, Jul 29 2017

Updating LAN drivers had no effect
Killing ATIECLXX.exe had no effect either.

Only change i did to my PC was that new AMD GPU driver installation. Problem arise right after restart required by installer (thats why my first suspect was AMD driver) .. but i dont know what Chrome version i had previously, i don't restart my PC often nor close Chrome so there is a chance there could have been update waiting.

Comment 9 by hork...@gmail.com, Jul 30 2017

Even Windows reinstall didn't helped.
Only installed things are Chrome, Avast and AMD Drivers 

Comment 10 by jri@chromium.org, Aug 3 2017

Mergedinto: 667820
Status: Duplicate (was: Untriaged)
I'd call this a dup of 667820. Marking it as such.

Comment 11 by jri@chromium.org, Aug 3 2017

Status: Available (was: Duplicate)
Actually, not sure if this is a dup... I'm trying to have all these hang conversations in the same place though. It may be too early to call this a dup. Un-duping.

Comment 12 by hork...@gmail.com, Aug 3 2017

Is there any way i can help to investigate this? I have to use different browser, chrome is unusable for me now :( Hangs are really common now.

Btw: don't know if it's related. But now when i have cursor in address bar i have to press Enter twice to get something to happen (doesn't have to press it twice on other PC's where that hangs arent appearing)
Labels: Hotlist-GoodFirstBug Network-Triaged
Opening and closing socket off thread seems like a nice thing for someone new to Chrome to investigate, though it's a bit more involved than most good first bugs.  Need to be careful to make sure there's no problem when there's a pending read/write, but otherwise...

Sign in to add a comment