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

ublock sometimes does not load site completely #3526

Closed
Juschi1 opened this issue Feb 19, 2018 · 24 comments
Closed

ublock sometimes does not load site completely #3526

Juschi1 opened this issue Feb 19, 2018 · 24 comments

Comments

@Juschi1
Copy link

Juschi1 commented Feb 19, 2018

Describe the issue

I have the following issue: Since two weeks or so, I have the problem, that sometimes firefox loads webpages not completely, when ublock active. It's about every 30. loading. Then, sometimes, elements of the webpage are missing or the webpage fails to load completely (white page) oder I see a mixup of the webpage and the sourcecode. I use firefox with no other add-ons installed with a fresh profile. If I deactivate ublock, the problem is gone. I have reinstalled ublock several times, resetted firefox and used a new profile. With "Adblock Plus" I don't have this issue but i want to use ublock.

One or more specific URLs where the issue occurs

It can happen on every webpage.

Screenshot in which the issue can be seen

http://fs1.directupload.net/images/180219/a4kelr3z.png
http://fs1.directupload.net/images/180219/l5cuxsnh.png

Steps for anyone to reproduce the issue

Your settings

  • OS/version: Win 7 64 Bit
  • Browser/version: Firefox 58.02 with new profile
  • uBlock Origin version: 1.15.6, default settings
Your filter lists

Everything default.

Your custom filters (if any)
@gorhill
Copy link
Owner

gorhill commented Feb 19, 2018

You failed to provide URLs where you see the issue (read carefully CONTRIBUTING).

@gorhill
Copy link
Owner

gorhill commented Feb 19, 2018

Labelling "available" = somebody who can reproduce will have to investigate -- it's unactionable otherwise.

@gorhill
Copy link
Owner

gorhill commented Feb 19, 2018

Ok, I've reproduced the case of "mixup of the webpage and the sourcecode" at https://www.heise.de/forum/startseite/:

a

So now I have something I can investigate.

@gorhill
Copy link
Owner

gorhill commented Feb 19, 2018

It's extremely difficult to reproduce -- but I did reproduce, though sometimes I reload the page 100+ times before I can see the issue happening.

I am going to need help in finding better repro steps. My guess is that it is related to response data filtering, but a specific code path: when only scriptlets need to be injected, which is the case on heise.de.

I try to stick to a "small" page, https://www.heise.de/forum/heise-online/Roboter/forum-371826/, and keep reloading the page until it occurs. But as said, extremely rare, it could be a timing issue. I looked at uBO's code, and nothing stands out as wrong, so it could be an obscure Firefox issue related to the stream filtering code.

I looked at the DOM when it finally happened again, and it is as if a chunk of response data was missing.

I did find another unrelated issue with that part of the code in uBO, which was a missing cleanup after injecting the scriptlet, but fixing this does not resolve the issue, I could make it happen again. It happens so rarely at this point that it's impossible to narrow the cause -- for all I know it could maybe also happen without uBO or with another blocker, it could be the server, it could be Firefox, etc.

An observation, but this would need to be confirmed, which is difficult given how rare the issue occurs on my side: it seems when the issue occurs, Firefox starts to severely leak memory, I see a lot of strings in about:memory which appears to be HTML source code strings.

@Juschi1
Copy link
Author

Juschi1 commented Feb 19, 2018

Cool. The Intend of coming back here was only to tell you that I can fully understand, that you can't give me any help due to the fact that I can't provide an exact way to reproduce my problem. I only wanted to make sure that I have reported the Issue because I have worked since a week to provide a reproducible way and, after eleminating all other causes, are now sure that it's in fact a problem with udblock.
For Example I have gone back to older versions of Firefox , tried Palemoon, old versions of palemoon, used new profiles, reset firefox, went to firefox portable and deinstalled firefox completely or tried to reproduce the behaviour with ABP. Always the same. It only happens with ublock and it is very unpredictable.

I love my firefox as well as ublock so much and can't image to renounce any of them.
But now I see that you relly was able to reproduce this problem. First of all: Many Thanks!!!

Second: I am now trying the ublock version from december 17 - 1.14.22. As you now know that the problem does not happen very often, I will see in the next 24 hours if it happens again. I am now using the old version since about 5 hours and my feeling is that the problem should have occurede since. So that's a good sign beginning to isolate the problem.

If I can provide you with any other informations you need, please let me know. I could - if you wish - go back to the -presumed- faulty version of ublock to give you other websites where the problem occures.
Or I could - if 1.14.22 continues to not have this problem - go step by step to a newer version to tell when it begins.

And don'd forget that this problem occued on several other websites also. I remember in particular chip.de (was today) for example but I have had this problem on many pages.

@h1z1
Copy link

h1z1 commented Feb 20, 2018

Can confirm this, and yeah it's not only rare it's quite weird like the elements are being rendered out of order or something. No doubt a browser problem but I certainly have NFI where. @Juschi1 do you run into things like seeing images render for half a second then disappear?

uM 1.1.21.3
uBO 1.14.23.1
Chromium 61.0.3163.100

@Hrxn
Copy link

Hrxn commented Feb 20, 2018

Well, if this is indeed the same phenomenon on Chromium we'll have a new problem here. The suspicion so far has been that this is related to the response data filtering, right? That would be Firefox only, at the moment.

Chromium 61.0.3163.100

BTW, what version is this? Current stable is at 64.0.3282.167/168..
Why test with an old version?

@h1z1
Copy link

h1z1 commented Feb 20, 2018

Chrome pushed forward with some questionable things. It's still the latest in repo though.

@uBlock-user
Copy link
Contributor

Well, if this is indeed the same phenomenon on Chromium we'll have a new problem here.

It's not. I'm on Chromium 66 and have used 64 in the past few months, nothing of this sort ever happened.

@h1z1
Copy link

h1z1 commented Feb 20, 2018

Removed my original reply as I misread what you said. Still have no idea why you gave a thumbs down but whatever.

@gorhill
Copy link
Owner

gorhill commented Feb 20, 2018

What I need help with at this point is with narrowing. If this is a timing issue, some of you may have better chance at reproducing the issue, and thus are better placed to help narrowing. At this point, my best guess is a very specific code path used when all the following conditions are met

  • there are scriptlets to be injected (which is the case on heise.de when "uBlock filters" is enabled)
  • the charset used is explicitly declared in the response header and is supported by uBO (which is the case on heise.de -- utf-8)
  • there is no HTML filtering for the site (which is the case for heise.de unless you have custom HTML filters, those using ##^)

To narrow should be simple enough:

  1. Confirm that you can reproduce the issue regularly by repeatedly loading pages from heise.de.

Narrowing:

  1. Create a local allow rule for heise.de using dynamic filtering:
    a
  2. This disables scriptlets injection -- so now see if you can reproduce the issue with scriptlet injection disabled: this is the tricky part of my side given how difficult it is for me to reproduce the issue. We have to find whether the issue really can't be reproduced or whether we are just unlucky in reproducing it.

@h1z1
Copy link

h1z1 commented Feb 20, 2018

Something I was playing with that may or may not be related but exhibits similar behavior is simply blocking images. If you block all requests to raw.githubusercontent.com on https://github.com/lenosisnickerboa/csgosl/wiki for example, on first load you'll see the placeholder. If you then allow images the first reload will not show anything. It takes one or more refresh attempts. You'll have to wait a bit between retries or force a cache flush (after a successful load).

Does that jive with anything here or is it completely different? I have had entire pages load as if it were blank as per above, wondering if these are related.

Update: was writing this before your reply above gorhill

@mapx-
Copy link

mapx- commented Feb 20, 2018

probably related:
uBlockOrigin/uAssets#1492

When an inject filter is used the page becomes blank on firefox

disabling the existing filter and adding other 1

mako.co.il#@#script:inject(abort-on-property-write.js, upManager)
mako.co.il##script:inject(set-constant.js, canRunAds, true)
  • adding only the exception one the page is loaded

@gorhill
Copy link
Owner

gorhill commented Feb 20, 2018

probably related:
uBlockOrigin/uAssets#1492

No, I looked at it. The issue is more likely that with Firefox the scriptlet is guaranteed to be injected at the top of the document, which is not the case for Chromium. If you view-source: the page, you will find that there is not much HTML code in there, the page is wholly generated using javascript. Defusing upManager breaks the javascript, hence breaks the page rendering.

The issue here is clear when it happens: Firefox is using a buffer with bad content in it.

@gorhill
Copy link
Owner

gorhill commented Feb 20, 2018

@mapx- Hmm, actually let me investigate more, not sure what the issue is. The page does not declare a <!DOCTYPE> so it can't be the same code path as the issue here.

@Juschi1
Copy link
Author

Juschi1 commented Feb 21, 2018

I have now used ublock 1.14.22 since 2 days and the problem did not occur. In the newest version the problem did occur about every few hours. My feeling is that the 1.14.22 is not affected.

@gorhill
Copy link
Owner

gorhill commented Feb 21, 2018

Try 1.15.11b0 on AMO, this version no longer use stream filtering to inject scriptlets. My best guess at this point is that there is an issue somewhere in Firefox's StreamFilter API.

@Juschi1
Copy link
Author

Juschi1 commented Feb 22, 2018

on AMO I only see 1.15.10

@uBlock-user
Copy link
Contributor

He meant the BETA version from here - https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/versions/beta

@Juschi1
Copy link
Author

Juschi1 commented Feb 23, 2018

gorhill added a commit that referenced this issue Feb 23, 2018
@gorhill
Copy link
Owner

gorhill commented Feb 23, 2018

I have the same problems in the beta

Yes, 1.15.11b0 is a dud -- I made a stupid mistake in the code in my haste to push a beta version before the Feb 22 deadline (the date at which AMO no longer allow beta versions to be uploaded).

@gorhill
Copy link
Owner

gorhill commented Feb 23, 2018

@Juschi1 You can use 1.15.10, this version does not rely on stream filtering for scriptlets injection. I don't know why I told you to use the beta version when 1.15.10 should work fine.

@jejo86
Copy link

jejo86 commented Feb 24, 2018

[Unrelated issue collapsed to minimize noise: filtering issue, report to uAssets, feel free to delete your comment -- gorhill]i had the same problem **every single time** on loading the page of [RARBG](https://rarbg.to/). you could see the page being loaded for a millisecond or so and then most of it was hidden, even though i allowed every ressource in uBlock. disabling uBlock helped, but i just found out that simply deactivating the "cosmetic filter" also solves my issue.

2018-02-24_135934
2018-02-24_140006

luckily this filter is only disabled on that page and not globally. well i guess luckily, i don't really know what it does.
i hope this could be related and of use to anyone having a similar problem.

@gorhill
Copy link
Owner

gorhill commented Dec 6, 2020

Closing as no longer an issue, I won't bring back injection scriptlets into the response data.

@gorhill gorhill closed this as completed Dec 6, 2020
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

No branches or pull requests

7 participants