Page 1 of 1

Crash when opening duden.de page

Posted: 2021-07-26, 21:42
by lexx9999
Hi PaleMoon Team,

I found PaleMoon 29.3 is crashing when opening a duden.de page like https://www.duden.de/rechtschreibung/Haus
It's consuming more an more memory while on high cpu load.
The script busy error reports line 2113 which contains:
let b = <unique_prefix>__base.getBoundingClientRect();
There is a <unique_prefix>__init function which is called from multiple observers including a MutationObserver.

BR Lexx

Re: Crash when opening duden.de page

Posted: 2021-07-30, 09:39
by Pentium4User
As I know it is caused by Google's WebComponents scripts that are in use there.

Re: Crash when opening duden.de page

Posted: 2021-07-30, 15:24
by seriousness
i just tried to go to duden.de and disable JavaScript in uBlock Origin for that site. Now it seems to work.

Re: Crash when opening duden.de page

Posted: 2021-07-30, 15:27
by New Tobin Paradigm
If it "crashed" how did you get an a message from the js watchdog that a script is unresponsive?

What was the crash exception code? How is this web compat when it is a crash?

Do you even know what a crash is?

Re: Crash when opening duden.de page

Posted: 2021-07-30, 17:06
by jars_
When open than site, PM freeze. I decided to wait.
After 3-4 minutes, I had a window that I never saw: "Not enough system memory, close other programs in order to prevent data loss" :o
Image
(PM ate 3,7gb of memory and fell)
... also, the browser Vivaldi fell where I watched a video on yt:
Image
It's something strange ... very strange :!: :?:
SfMBE

Re: Crash when opening duden.de page

Posted: 2021-07-30, 18:09
by Moonchild
jars_ wrote:
2021-07-30, 17:06
also, the browser Vivaldi fell where I watched a video on yt:
So you have a problem on your system then, not the browser.

Download a better computer.

Re: Crash when opening duden.de page

Posted: 2021-07-30, 19:01
by Moonchild
To the OP: problem seems to be an in-line script on duden's website that does some juggling with adding observers then (likely recursively) calling itself. This is a webmaster error; since it's an in-line script there's also not much we can do about it.
Please contact the site owners and ask them to look into it.
For the record, the script on the URL posted in this topic sits at line 2119 and surrounding, and is manipulating "laminashanalikala" elements, whatever that may be.

Re: Crash when opening duden.de page

Posted: 2021-07-30, 19:38
by Moonraker
No crashing here on linux...

Re: Crash when opening duden.de page

Posted: 2021-07-30, 21:29
by Moonchild
Moonraker wrote:
2021-07-30, 19:38
No crashing here on linux...
Crashing only happens if you run out of memory. That may take a long while depending on your architecture and amount of available ram :P

Re: Crash when opening duden.de page

Posted: 2021-08-01, 15:08
by lexx9999
Hi again,

I think the duden and chaturbate crashes have the same root cause. I saw both change style in the MutationObserver. It seems that chromium based browsers just ignore changes within a MutationObserver, but palemoon dies.

I've created a small standalone html (see attachment for full html), that triggers the problem (by enforcing a size change inside of the observer):

Code: Select all

var observer = new MutationObserver(function(mutations) {
  mutations.forEach(function(mutation) {
    target.style.width=.. // Setting to some different value KILLS PALEMOON
  });
});
Since there is no console output in Chromium I suppose they just ignore changes from within an MutationObserver-callback.

Hope that helps to fix the issue.

BR Lexx
BTW: Using and AddOn is not a fix, it's just a workaround.

Re: Crash when opening duden.de page

Posted: 2021-08-02, 01:25
by Moonchild
I already tried to indicate the cause of this. It's a recursive call of the observer.
The problem is that by setting the style attribute inside a mutationobserver without checking first if the style needs to be changed (and bailing if not), you are causing a mutation to the object which triggers the observer, which sets the style, which changes the object which triggers the observer, which... See what I'm getting at?

Of course it'd be desirable to at least not hang, so I'll look into that, but ultimately this kind of a construct is webmaster error, IMO.

Re: Crash when opening duden.de page

Posted: 2021-08-15, 12:05
by lexx9999
Well, I understand this.

IMO it's a conceptual error to have an interface like this. Especially when considering that every item may have slightly different sizes on each browser. So any Not-The-Big-Players-Browser is fucked up. By doing this "recursion" fixes, those player are actively supporting badly written code, finally I would blame the Chromium world to be the root cause of this problem.

Anyway I'm happy that you're looking at it. Thanks a lot.

Re: Crash when opening duden.de page

Posted: 2022-07-13, 09:44
by Moonchild
I've looked into this some more and we can't easily solve this on the browser side because the actual callback processing in JS is not in any way related to the mutationobserver.
What anyone who wants to observe a style change and then change that style in the callback should do to prevent issues (this has been a problem for all browsers, actually, and depending on what engine is used it may still be a problem) without needing to redesign their code is to simply make sure to immediately process the style changes and clear the observer queue by issuing an observer.takeRecords() after changing the style in the callback. This is a minimal, perfectly-safe change to website code that effectively stops falling into a recursion trap.