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

workaround for rachel.worldpossible.org, for discussion only #18

Merged
merged 1 commit into from Jan 5, 2016

Conversation

quozl
Copy link
Contributor

@quozl quozl commented Dec 28, 2015

Problem: when a page requests open new window by name, and a window of the same name has been opened and closed already, the new window will not be opened.

Workaround: stop and restart Browse.

Workaround: right-click and choose "Follow link in new tab".

Workaround: change the web content to use target="_blank" or no target attribute.

Diagnosis: WebKit keeps a list of browser windows by name, and is not told by Browse that the WebView has been closed.

Solution: destroy the WebView instance.

Causes new problem of log noise:

/home/olpc/Activities/Browse.activity/browser.py:104: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4631'
  self._browser.disconnect(self._load_status_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:477: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4632'
  self._browser.disconnect(self._uri_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:478: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4633'
  self._browser.disconnect(self._progress_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:479: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4634'
  self._browser.disconnect(self._loading_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:480: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4635'
  self._browser.disconnect(self._security_status_changed_hid)
/home/olpc/Activities/Browse.activity/edittoolbar.py:90: Warning: gsignal.c:2576: 
instance `0x9e2d678' has no handler with id `4636'
  self._browser.disconnect(self._selection_changed_hid)

Original problem report:

The issue is that if you have a web page open and click on a link that launches a second tab, then go to the new tab and close it, then you will not be able to open a new tab from such a link again.

Closing and restarting the Browser activity restores correct operation, until you close the new tab again.

This only happens in the Browser under Sugar; it works correctly under Gnome.

This is an issue because we have deployed RACHEL servers in many of the schools, and the RACHEL main page launches a new tab when you select an item from the home page.

The idea is that a student selects an item, a new tab opens, and when they are finished with it, closes the tab, which then leaves them back at the main page. This makes navigation easy for students as the main page is always open in its own tab.

The incorrect operation is causing confusion for the students.

You can demonstrate the problem online by pointing the Browser under Sugar to:

http://rachel.worldpossible.org//

then scrolling down and selecting the Infonet or Practical Action item. (@quozl adds: or just the first MedlinePlus Medical Encyclopedia index link A-Aq)

A new tab will open. Change to the new tab and close it. This will take you back to the main RACHEL screen. Click on the Infonet or Practical Action item and nothing happens.

If you right-click and select "Follow link in new tab" a new tab will open.

@quozl
Copy link
Contributor Author

quozl commented Dec 28, 2015

Does this imply that Browse will accumulate WebView objects even though tabs are closed.

Problem: when a page requests open new window by name, and a window of
the same name has been opened and closed already, the new window will
not be opened.

Workaround: stop and restart Browse.

Workaround: right-click and choose "Follow link in new tab".

Workaround: change the web content to use target="_blank" or no target
attribute.

Diagnosis: WebKit keeps a list of browser windows by name, and is not
told by Browse that the WebView has been closed.

Solution: destroy the WebView instance.

Causes new problem of log noise:

/home/olpc/Activities/Browse.activity/browser.py:104: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4631'
  self._browser.disconnect(self._load_status_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:477: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4632'
  self._browser.disconnect(self._uri_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:478: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4633'
  self._browser.disconnect(self._progress_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:479: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4634'
  self._browser.disconnect(self._loading_changed_hid)
/home/olpc/Activities/Browse.activity/webtoolbar.py:480: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4635'
  self._browser.disconnect(self._security_status_changed_hid)
/home/olpc/Activities/Browse.activity/edittoolbar.py:90: Warning: gsignal.c:2576: instance `0x9e2d678' has no handler with id `4636'
  self._browser.disconnect(self._selection_changed_hid)

--

Original problem report:

The issue is that if you have a web page open and click on a link that
launches a second tab, then go to the new tab and close it, then you
will not be able to open a new tab from such a link again.

Closing and restarting the Browser activity restores correct operation,
until you close the new tab again.

This only happens in the Browser under Sugar; it works correctly under
Gnome.

This is an issue because we have deployed RACHEL servers in many of the
schools, and the RACHEL main page launches a new tab when you select an
item from the home page.

The idea is that a student selects an item, a new tab opens, and when
they are finished with it, closes the tab, which then leaves them back
at the main page.  This makes navigation easy for students as the main
page is always open in its own tab.

The incorrect operation is causing confusion for the students.

You can demonstrate the problem online by pointing the Browser under
Sugar to:

	rachel.worldpossible.org

then scrolling down and selecting the Infonet or Practical Action item.

A new tab will open. Change to the new tab and close it.  This will take
you back to the main RACHEL screen.  Click on the Infonet or Practical
Action item and nothing happens.

If you right-click and select "Follow link in new tab" a new tab will
open.
@quozl
Copy link
Contributor Author

quozl commented Jan 4, 2016

Force push, missing destroy() method on DummyBrowser. Could not close PDF tabs.

@samdroid-apps
Copy link
Contributor

Wow, this is scary. If browsr is not deleting tabs this a great memory patch.

@quozl
Copy link
Contributor Author

quozl commented Jan 5, 2016

The problem as reported might be caused by the known pygobject memory leaks, leading to WebKit objects not being destroyed.

@samdroid-apps, yes, without #18 my web server logs show that a page reloading itself with http-equiv="refresh" does continue to be reloaded when a tab is closed, either with ctrl+w shortcut or the close tab button. Just can't see it.

I've done some further testing with #18, on Fedora 18 i386, OLPC XO-1.5 and XO-1.

I've tested with xdotool, as described in #4889, and found a difference in Browse VmSize depending on whether tabs are closed with ctrl+w (WebKit) or the close tab button (Browse);

  • 49 KB/sec is leaked using the ctrl+w shortcut,
  • 84 KB/sec is leaked using the close tab button,

However, xrestop, which shows X server pixmap allocations made on behalf of the Browse instance, shows that after 64 tab closures, using the ctrl+w shortcut, or the close tab button,

  • on XO-1.5, a 24-bit display, 231300 KB is leaked, about 600 KB/sec, or 3614 KB per tab,
  • on XO-1, a 16-bit display, 117475 KB is leaked, about 278 KB/sec, or 1835 KB per tab.

Opening a tab and closing it consumes pixmap memory. At somewhere between 200 and 400 tab closures on XO-1.5, the system begins to thrash, and the X server has filled memory with pixmaps allocated by Browse but not released. Closing Browse releases the allocation. Makes the Browse VmSize leak irrelevant by comparison.

Further evidence that the pygobject leaks can have severe impact.

@godiard
Copy link
Contributor

godiard commented Jan 5, 2016

Looks like a important fix. Will merge and do a release soon.

godiard added a commit that referenced this pull request Jan 5, 2016
workaround for rachel.worldpossible.org, for discussion only
@godiard godiard merged commit eb5f8ad into sugarlabs:master Jan 5, 2016
@godiard
Copy link
Contributor

godiard commented Jan 5, 2016

Thanks @quozl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants