sailfishos / sailfish-browser

Sailfish Browser

Home Page:https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eval crashes the browser

pycage opened this issue · comments

While working a lot with loading JavaScript modules dynamically, I noticed that the browser was prone to crash.
I was able to reduce the crash scenario to this minimal example, which almost certainly crashes
the browser every time:

<!DOCTYPE html>
<html>
<body>
    <script>
        for (let i = 0; i < 100000; ++i) eval("const a = 42;");
    </script>
</body>
</html>

Thank you for the report. We'll give a look.

Here's a backtrace for the crash, running the nemo/45.9.1+git19 version of gecko-dev:

backtrace.txt

It looks like this crash may have been fixed by @adenexter's gecko-dev commit 72e2b943 (not in the current release build). I'm just double checking this now.

Apparently it's not quite as simple as just applying 72e2b943. However, applying that along with the 9a33fc33 does seem to fix the issue.

I take back my previous comment. Commit 72e2b943 is indeed enough to address this. The following PR is enough to fix it for the next release: https://git.sailfishos.org/mer-core/gecko-dev/merge_requests/96

@pycage: thanks for your excellent report and finding a minimal example for triggering the bug. It's been a big help.

The changes for this have all been merged into gecko-dev master and the upgrade-3.3.0 branch, and will make it into the next release, so I'll close this now.

Thank you @llewelld 👍