pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

luakit: workaround the luakit high CPU usage after closing the last tab



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Thu Sep 14 16:05:33 2017 +0200
Changeset:	34162e17327d2b9bd5be40956ce566a21243fa61

Modified Files:
	luakit/TODO
	luakit/distinfo
Added Files:
	luakit/patches/patch-config_window.lua

Log Message:
luakit: workaround the luakit high CPU usage after closing the last tab

Without patches/patch-config_window.lua closing the last tab lead to an high CPU
usage by luakit process and in a completely stuck and unresponsive state.

I'm not sure if this is a correct/acceptable workaround/solution but it at least
make luakit finally usable.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=34162e17327d2b9bd5be40956ce566a21243fa61

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 luakit/TODO                            | 29 ++---------------------------
 luakit/distinfo                        |  1 +
 luakit/patches/patch-config_window.lua | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 27 deletions(-)

diffs:
diff --git a/luakit/TODO b/luakit/TODO
index f9bf80989f..d40016d4aa 100644
--- a/luakit/TODO
+++ b/luakit/TODO
@@ -1,27 +1,2 @@
-Some problems that needs to be investigated.
-
-Opening a tab and then close it get luakit stucks with a high CPU usage
------------------------------------------------------------------------
-To reproduce (at least on NetBSD/amd64 8.99.1):
-
- 1. Launch luakit
- 2. `:tabopen www.example.org' (this will switch to the new tab)
- 3. Close the `www.example.org' tab via `d'
- 4. High CPU usage for the `luakit' process in a stuck state
-
-Directly attaching gdb via `gdb -p `pgrep luakit`' reveals:
-
- (gdb) bt
- #0  0x000076b4124ac54a in ___lwp_park60 () from /usr/lib/libc.so.12
- #1  0x000076b41280a526 in pthread_cond_timedwait (cond=0x76b414792c10, mutex=0x76b414792be0, abstime=0x76b3fa5dff00)
-     at /usr/src/lib/libpthread/pthread_cond.c:169
- #2  0x000076b41a28cbbe in g_cond_wait_until () from /usr/pkg/lib/libglib-2.0.so.0
- #3  0x000076b41a21d1f9 in g_async_queue_pop_intern_unlocked () from /usr/pkg/lib/libglib-2.0.so.0
- #4  0x000076b41a21d7eb in g_async_queue_timeout_pop () from /usr/pkg/lib/libglib-2.0.so.0
- #5  0x000076b41a26fd3a in g_thread_pool_thread_proxy () from /usr/pkg/lib/libglib-2.0.so.0
- #6  0x000076b41a26f2e5 in g_thread_proxy () from /usr/pkg/lib/libglib-2.0.so.0
- #7  0x000076b41280c1cf in pthread__create_tramp (cookie=0x76b411bb6000) at /usr/src/lib/libpthread/pthread.c:593
- #8  0x000076b41248e8a0 in ?? () from /usr/lib/libc.so.12
- #9  0x0000000000000000 in ?? ()
-
-  -- leot (2017/09/08)
+- Get in touch with upstream to discuss patches/patch-config_window.lua (not
+  sure if it is the correct workaround/solution)
diff --git a/luakit/distinfo b/luakit/distinfo
index 54b358b7d9..fac6b1abd2 100644
--- a/luakit/distinfo
+++ b/luakit/distinfo
@@ -4,3 +4,4 @@ SHA1 (luakit-2017.08.10.tar.gz) = 9700901e09ec91f598df188e82972c0d2578aaed
 RMD160 (luakit-2017.08.10.tar.gz) = 144c400c408bdfc3385ee1c3b569351f1f0ae1af
 SHA512 (luakit-2017.08.10.tar.gz) = 6cceb241ca5a7ad7dfbb3964888318b5f2c5f734175ea7ecd5178419d037d58dc5e0aba00a7ed8ca3dd811cc5af953c353b0cd203be95a15c6a78c396f9230c8
 Size (luakit-2017.08.10.tar.gz) = 399564 bytes
+SHA1 (patch-config_window.lua) = ecf8a30ca267d6d0f29919bca952fa77cfc57607
diff --git a/luakit/patches/patch-config_window.lua b/luakit/patches/patch-config_window.lua
new file mode 100644
index 0000000000..650d5b2811
--- /dev/null
+++ b/luakit/patches/patch-config_window.lua
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Do not destroy() the current view.
+
+When just one tab is present it leads to an high CPU usage and luakit completely
+stuck (although start luakit via `--log=DEBUG' option shows that it responds to
+events). To workaround this problem avoid to call view:destroy().
+
+XXX: I'm not sure if it's the correct fix.
+
+--- config/window.lua.orig	2017-08-10 09:50:15.000000000 +0000
++++ config/window.lua
+@@ -519,7 +519,6 @@ window.methods = {
+         view = view or w.view
+         w:emit_signal("close-tab", view)
+         w:detach_tab(view, blank_last)
+-        view:destroy()
+     end,
+ 
+     attach_tab = function (w, view, switch, order)


Home | Main Index | Thread Index | Old Index