greasemonkey / greasemonkey

Greasemonkey is a user script manager for Firefox.
http://www.greasespot.net/
Other
2.32k stars 327 forks source link

Greasemonkey 1.6 freezes #1689

Closed Zack-od-Bins closed 11 years ago

Zack-od-Bins commented 11 years ago

Since this update 1.6 I've gotten browser crashes in Firefox 18 at every load of webpages. There haven't been updates for other add-ons at the time of this update nor after it. I had to completely disable Greasemonkey. I'm not really sure what other info I could or should provide here. This is my first post at GitHub. Cheers.

arantius commented 11 years ago

http://wiki.greasespot.net/Troubleshooting_(Users)

Especially fresh profile. Perhaps try disabling all scripts first, does that help? If so, enable them one by one to see which causes it.

Zack-od-Bins commented 11 years ago

It seems when I disable Google Hit Hider by Domain, Greasemoney no longer crashes FF. Do I need to report the problem to the maker then ?

arantius commented 11 years ago

We're talking about http://userscripts.org/scripts/show/95205 ?

A script should never be able to crash Firefox, so if that's really happening, it's definitely something we should look into.

Zack-od-Bins commented 11 years ago

Yes, that is the script I am referring to. I've been using it for two years now. It has never given me any trouble before. Only since the most recent Greasemonkey update.

Ventero commented 11 years ago

The problematic commit seems to be 1250bd7adc647826c66bd2eaafbf68b4a6bbaca0 - a build with that commit reverted does not result in any noticeable hangs (which apparently is meant by "crashes"). The reason is probably that the linked script uses quite a lot of @includes and @excludes with the magic .tld suffix, so that GM takes a lot of time when trying to match those includes against the current URL.

Zack-od-Bins commented 11 years ago

I'll clarify what I meant. By "crashes" I mean that Firefox stops responding, otherwise said: freezes.

arantius commented 11 years ago

Back in issue #1351 where this was added, I specifically did timing on the impact of such a big regex. And I got tiny fractions of milliseconds. But multiple people have filed "reviews" at AMO rather than bug reports here already, so this is obviously a serious issue.

Plus the AMO review of 1.6 said:

If you're going to use the public suffix database for your TLD checks, please do so via the nsIEffectiveTLDService rather than including a separate copy of the DB in regex form in your extension.

Maybe rather than substituting a big regex in place of .tld, we should detect its presence, find the actual TLD of the current URL (via nsIEffectiveTLDService), and substitute that into the pattern.

AlienHeads commented 11 years ago

I'm having the same problem, it happens with all scripts disabled. I don't even have to try to load a page, as soon as i try to click anything with the greasemonkey icon FF stops responding i.e. clicking the monkey to enable/disable or the arrow for options.

I've gone back to using version 1.5 & that works fine.

arantius commented 11 years ago

Confirmed. First I installed ten scripts which each mentioned .tld once. I got a tiny pause that I couldn't possibly call a crash or a freeze, hardly noticable. I changed them each to have ten mentions of .tld (still times ten scripts) and I see a ~3 second pause to navigate/open the monkey menu. Which makes for a delay of something like 30ms per, way way more than the 0.02ms estimated in #1351.

arantius commented 11 years ago

Plan on pushing this build live some time today to fix the issue; I'd love confirmation from someone experiencing this bug that it really fixes things.

http://dl.dropbox.com/u/6784911/greasemonkey-1.7.xpi

stefansp commented 11 years ago

@arantius greasmonkey does not load any scripts with your version.

arantius commented 11 years ago

Thanks, just noticed and fixed 262ddf36bb50f234f72cb1c7c89c1e46955a38cf ; give it another shot if it's not too much trouble. Thanks.

stefansp commented 11 years ago

the new version fixes the freezes.

AlienHeads commented 11 years ago

Excuse my ignorance but where is the new version?

Lekensteyn commented 11 years ago

1.7.1 (from git) is confirmed to work. I experienced sluggish behavior and initially blamed FF for this, but with a new profile it still occurred. Then I disabled some add-ons and it turned out to be GM. With random disabling GM scripts, I isolated one script out of it which had three .tld includes. This already slowed down the browser for less than a second (noticeable though).

Using a script containing 100 $i.example.tld includes, the browser would ask me to terminate GM after thirty seconds. The new 1.7.1 version solves this performance regression and the include is still working (tested excludes and includes).

(fyi, a test script that I have been running shows that Firefox 18 takes about 337ms where Chromium 24 is almost immediately done (0-5ms))