Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Pressing cmd/ctrl + w sometimes makes entire UI unresponsive #9083

Closed
alexwykoff opened this issue May 26, 2017 · 27 comments · Fixed by #10640
Closed

Pressing cmd/ctrl + w sometimes makes entire UI unresponsive #9083

alexwykoff opened this issue May 26, 2017 · 27 comments · Fixed by #10640

Comments

@alexwykoff
Copy link
Contributor

alexwykoff commented May 26, 2017

- Did you search for similar issues before submitting this one?

Yes

- Describe the issue you encountered:

After opening a lot of tabs (> 20) , I then try to close them rapidly with a key-combo of cmd/ctrl + w

- Platform (Win7, 8, 10? macOS? Linux distro?):

macOS 10.12.6 x64 - Reproduced
Win 10 x64 - Reproduced

- Brave Version (revision SHA):

Brave: 0.18.29 
rev: 85f059d83b8861b3a7e127c42b2fe9d574be5810 
Muon: 4.3.16 
libchromiumcontent: 60.0.3112.113
Brave: 0.18.32 
rev: e94738d9f289e9fb1a0e95aea29ee2c37196a271 
Muon: 4.3.18 
libchromiumcontent: 61.0.3163.71

- Steps to reproduce:

  • open Brave 0.18.32 rev: e94738d
  • open a page of two worth of tabs by holding ctrl+t
  • while you're holding ctrl+t, quickly switch over to ctrl+w and start closing tabs
  • you'll notice after closing a few tabs, the entire UI will become unresponsive

The following erros appear in the terminal when running Brave locally:

(node:3642) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 app-state-change listeners added. Use emitter.setMaxListeners() to increase limit
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 app-state-change listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:262:19)
    at AppStore.addListener (events.js:279:10)
    at AppStore.addChangeListener (/Users/kjozwiak/projects/browser-laptop/js/stores/appStore.js:290:10)
    at EventEmitter.ipcMain.on (/Users/kjozwiak/projects/browser-laptop/app/browser/tabs.js:125:12)
    at emitOne (events.js:96:13)
    at EventEmitter.emit (events.js:191:7)
    at WebContents.<anonymous> (/Users/kjozwiak/projects/browser-laptop/node_modules/electron-prebuilt/dist/Brave.app/Contents/Resources/electron.asar/browser/api/web-contents.js:182:13)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:194:7)
An uncaught exception occurred in the main process Uncaught Exception:
Error: Object has been destroyed
    at getTabValue (/Users/kjozwiak/projects/browser-laptop/app/browser/tabs.js:53:38)
    at tabState.getTabsByWindowId.forEach (/Users/kjozwiak/projects/browser-laptop/app/browser/tabs.js:992:27)
    at List.__iterate (/Users/kjozwiak/projects/browser-laptop/node_modules/immutable/dist/immutable.js:2208:13)
    at List.forEach (/Users/kjozwiak/projects/browser-laptop/node_modules/immutable/dist/immutable.js:4383:19)
    at Object.updateTabsStateForWindow (/Users/kjozwiak/projects/browser-laptop/app/browser/tabs.js:988:49)
    at Object.updateTabsStateForAttachedTab (/Users/kjozwiak/projects/browser-laptop/app/browser/tabs.js:985:16)
    at tabsReducer (/Users/kjozwiak/projects/browser-laptop/app/browser/reducers/tabsReducer.js:74:20)
    at reducers.reduce (/Users/kjozwiak/projects/browser-laptop/js/stores/appStore.js:382:24)
    at Array.reduce (<anonymous>)
    at applyReducers (/Users/kjozwiak/projects/browser-laptop/js/stores/appStore.js:380:68)

- Actual result:

After a period, Brave will stop responding and you will be stuck on a particular tab.
Pausing and trying to use ctrl/cmd + w will have no effect. The entire Brave UI will also become unresponsive.

- Expected result:

Tabs should be closed without the entire UI becoming unresponsive.

- Will the steps above reproduce in a fresh profile? If not what other info can be added?

Yes

- Is this an issue in the currently released version?

Yes

- Can this issue be consistently reproduced?

Yes

- Screenshot if needed:

unresponsiveui

@alexwykoff alexwykoff added the bug label May 26, 2017
@alexwykoff alexwykoff added this to the 0.16.100 (Frozen, only critical adds from here) milestone May 26, 2017
@cndouglas
Copy link

+1 from me. Brave 0.15.310 on macOS 10.12.x. Cmd+W doesn't have to be rapid to cause this problem.

Possibly related: #9065 and #45.

@cndouglas
Copy link

cndouglas commented Jun 9, 2017

So far, I haven't been able to reproduce with 0.16.6, but I'll keep trying just to be sure.

@bsclifton
Copy link
Member

bsclifton commented Jun 9, 2017

Wasn't this fixed with #8740? (which deployed with 0.15.314)

@liunkae you might try the 0.15.314 and see if you can make it happen. If unable to reproduce, let's remove milestone / close issue 😄

@cndouglas
Copy link

Yeah, I think it was fixed in 0.15.314. Closing.

@cndouglas cndouglas removed this from the 0.17.x (Frozen, only critical adds from here) milestone Jun 9, 2017
@cndouglas
Copy link

Never mind, I was just able to reproduce with 0.16.6.

@cndouglas cndouglas reopened this Jun 9, 2017
@cndouglas cndouglas added this to the 0.17.x (Frozen, only critical adds from here) milestone Jun 9, 2017
@cndouglas
Copy link

Cmd+W does not work.
Closing the tab from the tabbar works.
Closing from the menu works.

I'm still trying to get a consistent STR.

@cndouglas
Copy link

I get this error in the browser-level console:
Unchecked runtime.lastError while running guestViewInternal.destroyGuest: Unknown error. index.html:1

@bbondy
Copy link
Member

bbondy commented Jun 13, 2017

@alexwykoff @liunkae Could this be mac only? I tried to reproduce this with 0.16.9 by going as fast as I could and I couldn't on Linux and Windows.

@cndouglas
Copy link

cndouglas commented Jun 13, 2017

It may have been fixed for Windows and Linux with #8740. I can still reproduce with 0.16.9 on Mac after some browsing (with the error above).

@cndouglas
Copy link

I'm getting the same error message when I encounter #9385. These problems may be related. Maybe something goes wrong with the tab state.

@cezaraugusto
Copy link
Contributor

@bbondy pointed that #9539 might have fixed it and I confirm I no longer see this running macOS. @alexwykoff mind confirming that?

@cezaraugusto cezaraugusto added the needs-info Another team member needs information from the PR/issue opener. label Jun 20, 2017
@bbondy
Copy link
Member

bbondy commented Jun 21, 2017

Moving to 0.18.x I'm not able to reproduce.
I do notice some lag that makes it seems like cmd+w doesn't work, but it works if you wait for the pages to load. See steps below that I tried to reproduce with.

Alex shared these steps:

using keyrepeat (holding down cmd + w) i can repro pretty easily under the following scenario:
1. set homepage to reddit.com/r/random [and homepage for newtab setting]
2. use keyrepeat with cmd+t to open 5-6 tab pages worth of tabs (don't wait for tabs to finish loading)
3. use keyrepeat with cmd+w to close tabs
after what feels like 10-20 tabs, it appears to stop responding

similar scenario
1. same as ^
2. use keyrepeat with cmd+n to open ~20-30 windows (don't wait for windows to finish loading)
3. use keyrepeat with cmd+w to close windows
after what feels like 5-10 windows, it appears to stop responding


@bbondy bbondy modified the milestones: 0.18.x (Developer Channel), 0.17.x (Beta Channel) Jun 21, 2017
@cndouglas
Copy link

cndouglas commented Jun 21, 2017

I have not been able to reproduce with 0.17.3. I think it was fixed in 0.17.x.

Just reproduced with 0.17.4. Definitely much rarer than 0.16.x, though.

@bsclifton
Copy link
Member

Per @NejcZdovc, if someone is trying to reproduce, try launching from command line... this way the browser process will log stdout with something like window ID not found

@cndouglas
Copy link

Just reproduced with the console up. No output.

When it gets in that state, the tab cannot be closed with Cmd+W, but it can be closed with the tabbar close button. Maybe it's related to the keyboard shortcut. I started noticing the problem around 0.15.x, which is when #45 was implemented.

@bsclifton
Copy link
Member

bsclifton commented Jun 26, 2017

OK I'm able to reproduce this... I don't see any errors being logged though (to browser dev tools or to command line)

Here are my steps:

  1. Have a fresh session w/ Brave
  2. On the new tab page, middle click (or cmd/ctrl click) on the new tab icons until you have about 5 tab pages worth of tabs
  3. Go to the last tab page
  4. Hold down Cmd/Ctrl + w
  5. eventually you'll have a white page

What happens is: the tabs are being close so fast it doesn't seem to pick a new active tab

This may be related to #9306

@bsclifton bsclifton modified the milestones: 0.17.x (Beta Channel), 0.18.x (Developer Channel) Jun 27, 2017
@cndouglas
Copy link

Why was this reopened?

@kjozwiak kjozwiak changed the title Pressing cmd/ctrl + w sometimes does not close tabs Pressing cmd/ctrl + w sometimes does not close tabs and UI becomes unresponsive Sep 11, 2017
@kjozwiak kjozwiak changed the title Pressing cmd/ctrl + w sometimes does not close tabs and UI becomes unresponsive Pressing cmd/ctrl + w sometimes makes entire UI unresponsive Sep 11, 2017
bbondy added a commit that referenced this issue Sep 12, 2017
This doesn't actually stop dead tabs from happening, but when it does at
least it won't break the entire UI now.

Fix #9083

Auditors: bridiver
@bbondy bbondy closed this as completed in 43ff261 Sep 12, 2017
bbondy added a commit that referenced this issue Sep 12, 2017
This doesn't actually stop dead tabs from happening, but when it does at
least it won't break the entire UI now.

Fix #9083

Auditors: bridiver
bbondy added a commit that referenced this issue Sep 12, 2017
This doesn't actually stop dead tabs from happening, but when it does at
least it won't break the entire UI now.

Fix #9083

Auditors: bridiver
bbondy added a commit that referenced this issue Sep 12, 2017
This doesn't actually stop dead tabs from happening, but when it does at
least it won't break the entire UI now.

Fix #9083

Auditors: bridiver
@bbondy
Copy link
Member

bbondy commented Sep 12, 2017

0.18.x: 78a0757
0.19.x: 747176c
0.20.x: cbea3e0
master: 43ff261

@bbondy
Copy link
Member

bbondy commented Sep 14, 2017

Can leave dead tabs still but doesn't freeze up entire UI anymore. 👍

@kjozwiak
Copy link
Member

Can leave dead tabs still but doesn't freeze up entire UI anymore. 👍

Same results. The dead tabs issue will be covered in #10905.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.