madand / pentadactyl-pm

Pentadactyl for Pale Moon | New official repo is here https://github.com/pentadactyl/pentadactyl
Other
26 stars 4 forks source link

Pale Moon freezing on / search #2

Open Massimo-B opened 7 years ago

Massimo-B commented 7 years ago

Going to https://sourceforge.net/p/gsoap2/bugs/search/?q=proxy&page=1 and starting a / search with "proxy" makes my Pale Moon freezing with high cpu usage. Can anyone reproduce that?

krayon commented 7 years ago

Using Palemoon 27.3.0 and Pentadactyl 1.2pre-pm-3 release (XPI from palemoon.org), with all JS enabled (NoScript disabled), I cannot replicate this issue.

Interestingly, and possibly related, I DO get a different bug. Namely, when I press 'n' the search only switches between the first match (the string "Search bugs: proxy") and the textbox and back again. When matching the first match, pressing 'N' will take me to the last one. Continuing to press 'N' will backwards match until it gets to the text box. Then, the next 'N' will jump back to the last match again.

It would seem matching the textbox somehow forgets the search position.

NOTE: I haven't tried any of this with GIT master yet (not sure if that's different from the XPI on palemoon.org).

Massimo-B commented 7 years ago

I forgot to add, this is www-client/palemoon-bin-27.3.0 from the palemoon overlay with Pentadactyl 1.2pre-pm-3.

I tried again with a fresh PM profile and --new-instance, then installed a fresh Pentadactyl 1.2pre-pm-3 from the PM addon site. I'm still able to reproduce the issue:

  1. Go to https://sourceforge.net/p/gsoap2/bugs/search/?q=proxy&page=1
  2. Accept cookie popup
  3. Start searching by / (typing the search is possible while I see some Warning: -- FIND FORWARD -- resource://dactyl/finder.jsm:591: Ary#iterValues is deprecated: Please use Array#values instead.)
  4. Type proxy
  5. Press Return:

PM is frozen, you cannot scroll anymore. PM instance is consuming 26.5% CPU on top with 4 cores here.

I guess I have too few debug symbols, taking a short look inside strace:

# strace -C -p "$(pidof palemoon)"
strace: Process 21946 attached
strace: [ Process PID=21946 runs in x32 mode. ]
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
strace: [ Process PID=21946 runs in 64 bit mode. ]
rt_sigreturn({mask=[]})                 = 140390369067176
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
rt_sigreturn({mask=[]})                 = 140390369079648
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
rt_sigreturn({mask=[]})                 = 140390369091040
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2b500000
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
rt_sigreturn({mask=[]})                 = 140391459600641
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2b400000
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2b300000
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
rt_sigreturn({mask=[]})                 = 140390369116008
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2b200000
--- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TKILL, si_pid=21946, si_uid=4728} ---
rt_sigreturn({mask=[]})                 = 140390369128344
mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7faf2b100000
^Cstrace: Process 21946 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
  0.00    0.000000           0         5           mmap
  0.00    0.000000           0         6           rt_sigreturn
------ ----------- ----------- --------- --------- ----------------
100.00    0.000000                    11           total
madand commented 7 years ago

I can reproduce the issue on:

Pentadactyl 1.2pre-pm-3 running on:
Mozilla/5.0 (X11; Linux x86_64; rv:3.2) Goanna/20170422 PaleMoon/27.3.0

Freezes occur when you search for a word that is also present within a text input box on the page.

I found the same issue reported upstream 5digits/dactyl#206, so it is not specific to PaleMoon port.

This kind of issue requires deep knowledge of Pentadactyl's implementation, thus we should wait for upstream maintainers to handle it. I labelled it accordingly in this repo, and leave it open until there is a fix upstream.

afarah1 commented 7 years ago

See here for a workaround while it's not fixed.

Massimo-B commented 6 years ago

Hi, this bug is very annoying as it requires to kill my whole browser session. I did not apply that workaround yet. So you remove that loop? Which highlight feature is broken by that? Did you fork your bugfix branch already? Maybe we should do that and file a pull request until some developer has a real bugfix.

xaizek commented 6 years ago

@Massimo-B, I worked around it like this:

 common/modules/finder.jsm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/modules/finder.jsm b/common/modules/finder.jsm
index 90745ee0..fbc8b24a 100644
--- a/common/modules/finder.jsm
+++ b/common/modules/finder.jsm
@@ -533,7 +533,7 @@ var RangeFind = Class("RangeFind", {
             let regexp = this.regexp && word != util.regexp.escape(word);
             this.lastRange = null;
             this.regexp = false;
-            if (regexp) {
+            if (true || regexp) {
                 let re = RegExp(word, "gm" + this.flags);
                 for (this.range of this.ranges) {
                     for (let match of util.regexp.iterate(re, DOM.stringify(this.range.range, true))) {

Which gives the behaviour described by @krayon above. The issue seems to happen if some text field matches the pattern. I didn't really get how it works and why it hangs though, have no idea even how to properly debug it.

Massimo-B commented 5 years ago

Still unstable as commented here. I have the .pentadactylrc from troyp, however I don't have the patch from xaizek, testing this now...

No, added the patch, rebuild the xpi, reinstalled to Palemoon 28, still freezing.