Infinite loop loading Flipkart.com because the site's regex fails to match Firefox's JS error message

RESOLVED FIXED

Status

defect
P1
critical
RESOLVED FIXED
8 months ago
4 months ago

People

(Reporter: denispal, Assigned: jorendorff)

Tracking

(Blocks 1 bug, {regression, site-compat})

Dependency tree / graph

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox62 unaffected, firefox63blocking fixed, firefox64blocking fixed, firefox65blocking fixed, firefox66blocking fixed)

Details

Attachments

(1 attachment)

Reporter

Description

8 months ago
Posted image screencap.png
When loading www.flipkart.com using a geckoview_example build from revision ddcd7cc2f3cd, I see an infinite loop trying to load the web page.  

This is on a Samsung S7 edge running Android 8.0.
Over to Kevin for deeper triage (DUPE?)
Assignee: nobody → kbrosnan
Is this a regression?

James says he can repro in Fennec (64?).
Hardware: ARM64 → Unspecified
[Tracking Requested - why for this release]: looks to be a 63 regression
Flipcart is a very large commerce site in India.

25:17.80 INFO: No more inbound revisions, bisection finished.
25:17.80 INFO: Last good revision: 5d6bf0312e088bb2424a8177589a9fd4aa44bfa8
25:17.80 INFO: First bad revision: f0c6e521429cfaff0585ec6eaf734e9fcf873f8a
25:17.80 INFO: Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=5d6bf0312e088bb2424a8177589a9fd4aa44bfa8&tochange=f0c6e521429cfaff0585ec6eaf734e9fcf873f8a
Blocks: 1259822
Flags: needinfo?(jorendorff)
Flags: needinfo?(arai.unmht)
See Also: → 1490772
(In reply to Denis Palmeiro [:denispal] from comment #0)
> geckoview_example build from revision ddcd7cc2f3cd

where can I get it?
Flags: needinfo?(kbrosnan)
Reporter

Comment 6

8 months ago
To build geckoview example app, I used the following build & install commands:

./mach build
./mach package
./mach android archive-geckoview
./mach gradle geckoview_example:installLocalWithGeckoBinariesNoMinApiDebug

The apk is also available on taskcluster:
https://tools.taskcluster.net/index/gecko.v2.mozilla-central.latest.mobile/
Flags: needinfo?(kbrosnan)
in https://img1a.flixcart.com/www/linchpin/batman-returns/app.c7ed1ee40ce.bundle.js
there's the following function:

    function(t, e, n) {
        "use strict";

        function o(t, e) {
            try {
                return e(t)
            } catch (t) {
                if (t instanceof TypeError) {
                    if (i.test(t)) return null;
                    if (r.test(t)) return
                }
                throw t
            }
        }
        var i = /^null | null$|^[^(]* null /,
            r = /^undefined | undefined$|^[^(]* undefined /;
        o.default = o, t.exports = o
    }

it's checking the message, and the rules (i and r) are based on the previous messages which ends with "null" or "undefined", but now the message continues with "; ..."
Flags: needinfo?(arai.unmht)
the actual error thrown there is
  TypeError: t.jsBundles is undefined; can't access its "checkout" property
which doesn't match the above rule
Assignee

Comment 11

8 months ago
Wow. This JS library actually looks for specific patterns in error messages, using RegExps. Our improved error message does not match what the library expects to see.

This whole idea seems to have unfixable bugs... just for starters:
  https://github.com/facebookincubator/idx/issues/51

Of course that doesn't help us much. This is a pretty big site; the bug happens not to affect desktop Firefox, but I guess only because they're doing UA sniffing (i.e. we got lucky).

What are our options? Treat this as tech evangelism; back out the change altogether; change the error message to whatever exact words V8 uses; change it to something else. The first two are options for Firefox 53.

I'm going to ask Product to make a call on this. It's pressing, obviously.
Assignee

Comment 12

8 months ago
Actually, on second thought, let's just back it out. :-P

Stealing the bug.
Assignee: kbrosnan → jorendorff
Flags: needinfo?(jorendorff)
geckoview62=unaffected because this bug is a regression from bug 1259822 in Firefox 63.
Summary: Infinite loop loading www.flipkart.com → Infinite loop loading Flipkart.com because the site's regex fails to match Firefox's JS error message
Assignee

Comment 15

8 months ago
Fixed by backout on mozilla-release:
https://hg.mozilla.org/releases/mozilla-release/rev/ea4b5c999c575532506dfe6c702f59c5a268983b

I think we already missed RC1, so the fix will be in FF63 RC2.
Marked the compat note reverted.
Assignee

Comment 17

8 months ago
Fixed by backout on mozilla-beta:
https://hg.mozilla.org/releases/mozilla-beta/rev/0e99081b5322d213fdba77a12ebbf6293f9c2a7f

We missed beta 1, so the fix will be in FF64 beta 2.
Assignee

Comment 18

8 months ago
OK. Now let's hand this over to Tech Evangelism to see if anything can be done.

If not, we give up and graft the backout from beta to Nightly. :-|
Assignee

Updated

8 months ago
Component: GeckoView → Mobile
Product: Firefox for Android → Tech Evangelism
Hmm, I guess the first step is filing a bug against the FB lib. Fixing upstream is easy, but it's an uphill battle getting all the sites that might break to upgrade...
Flags: needinfo?(miket)
Assignee

Updated

8 months ago
Assignee: jorendorff → nobody
Severity: normal → critical
Assignee

Comment 20

8 months ago
The backout on beta failed. I'll look at it later today.
Assignee: nobody → jorendorff
Flags: needinfo?(jorendorff)
Assignee

Updated

8 months ago
Blocks: 1488554
Flags: needinfo?(jorendorff)
Assignee

Updated

8 months ago
Flags: needinfo?(jorendorff)
Assignee

Comment 21

8 months ago
I don't feel great about this, but my plan is to fix bug 1493560, then re-land the backout on beta.

This is complicated by the fact that I can't reproduce that bug locally, even in that exact revision -- only in test infra, where it seems to happen every time.
Assignee

Updated

8 months ago
Depends on: 1493560
Flags: needinfo?(jorendorff)
Assignee

Updated

8 months ago
Flags: needinfo?(jorendorff)
Jason, how is bug 1488554 involved here, which you set as being blocked by this bug? I assume it was a spelling mistake?
Assignee

Updated

8 months ago
Blocks: 1488417
No longer blocks: 1488554
Flags: needinfo?(jorendorff)
Assignee

Updated

8 months ago
Flags: needinfo?(jorendorff)
About flipkart, it is a regular of webcompat, multiple reports different issues, one after the other.
https://webcompat.com/issues/17588
See Also: → 1512401
Jason this still affects 64, did anything happen for this after comment 21?  Do we need to uplift 1493560 now and re-land the backout?
Assignee

Comment 26

6 months ago
Yes, that's exactly what needs to happen here. Sorry for dropping this.

The backout also needs to land in beta (65) and central. We just can't have nice things.
Flags: needinfo?(jorendorff)
Assignee

Comment 28

6 months ago
ni?me to make sure the backouts happen in beta and central.
Flags: needinfo?(jorendorff)
Assignee

Updated

6 months ago
Flags: needinfo?(aryx.bugmail)
Looks like the backout doesn't apply cleanly to 65+. Will need rebasing by you, Jason.
Flags: needinfo?(aryx.bugmail)
This has been backed out from all branches now.
Status: NEW → RESOLVED
Closed: 6 months ago
Flags: needinfo?(jorendorff)
Resolution: --- → FIXED
Denis, can you confirm that everything works OK for you now?
Flags: needinfo?(dpalmeiro)
Reporter

Comment 32

6 months ago
Not sure how to interpret my experience.  It works using Focus 8.0.3 that has a 64.0.20181214004633 build of Geckoview.   However, it seems intermittent when using Fennec Nightly using a 2018-12-26 build.   Sometimes it loads, and other times it doesn't.  And when it does load, it usually doesn't load properly on a refresh.  I tried clearing storage, cache and reinstalling Nightly but it doesn't change the behaviour.
Flags: needinfo?(dpalmeiro)
(In reply to Denis Palmeiro [:denispal] from comment #32)
> Not sure how to interpret my experience.  It works using Focus 8.0.3 that
> has a 64.0.20181214004633 build of Geckoview.   However, it seems
> intermittent when using Fennec Nightly using a 2018-12-26 build.   Sometimes
> it loads, and other times it doesn't.  And when it does load, it usually
> doesn't load properly on a refresh.  I tried clearing storage, cache and
> reinstalling Nightly but it doesn't change the behaviour.

Denis, can you please file a new bug about the Fennec Nightly issue? This bug report has a lot of history about the JS error messages. Tracking the Fennec Nightly issue will be easier in a fresh bug. :)
Flags: needinfo?(dpalmeiro)
Reporter

Updated

5 months ago
See Also: → 1518484
Reporter

Comment 34

5 months ago

(In reply to Chris Peterson [:cpeterson] from comment #33)

(In reply to Denis Palmeiro [:denispal] from comment #32)

Not sure how to interpret my experience. It works using Focus 8.0.3 that
has a 64.0.20181214004633 build of Geckoview. However, it seems
intermittent when using Fennec Nightly using a 2018-12-26 build. Sometimes
it loads, and other times it doesn't. And when it does load, it usually
doesn't load properly on a refresh. I tried clearing storage, cache and
reinstalling Nightly but it doesn't change the behaviour.

Denis, can you please file a new bug about the Fennec Nightly issue? This
bug report has a lot of history about the JS error messages. Tracking the
Fennec Nightly issue will be easier in a fresh bug. :)

Filed bug 1518484.

Flags: needinfo?(dpalmeiro)
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.