Skip to main content

Bug Tracker

Side navigation

#12497 closed bug (fixed)

Opened September 10, 2012 01:02AM UTC

Closed November 08, 2012 03:30AM UTC

Last modified November 09, 2012 02:49AM UTC

jQuery 1.8.1 transitions crashing android 2.3.4 browser

Reported by: alanneilnix@gmail.com Owned by: alanneilnix@gmail.com
Priority: low Milestone: 1.8.3
Component: effects Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:
Description

The following code seems to be crashing the stock browser on Android 2.3.4 devices when using jQuery 1.8.1:

$(".feedback_active").fadeOut('slow', function(){
    $("#feedback_" + feedback_id).fadeIn().addClass('feedback_active');
}).removeClass('feedback_active');

I have reverted back to 1.7.2 and things are working normally for now.

Attachments (0)
Change History (23)

Changed September 10, 2012 01:10AM UTC by mikesherov comment:1

owner: → alanneilnix@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery git("edge") version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/. Open the link and click to "Fork" (in the top menu) to get started.

Changed September 10, 2012 02:17AM UTC by alanneilnix@gmail.com comment:2

status: pendingnew

Here is the jsfiddle: http://jsfiddle.net/Y5F7C/1/

I was able to reproduce the issue on my phone with jQuery (edge) as well. Just some more info, I'm using a HTC Incredible 2 (Incredible S outside the US) on Android 2.3.4 with the stock browser.

Changed September 17, 2012 04:15PM UTC by alanneilnix@gmail.com comment:3

Any update on this? Were you able to reproduce the problem with the provided jsfiddle?

Changed September 17, 2012 06:30PM UTC by dmethvin comment:4

status: newpending

I have Android 2.3.6 on a Nexus One and it seems to work fine. Can you describe what is happening when it "crashes"?

Also, in general the code there is a very bad pattern to follow because it is assuming the animations will complete within the setTimeout interval. Code like this is why we had to back out our requestAnimationFrame support. Instead, have the completion callback set the timer for example.

Changed September 17, 2012 06:43PM UTC by alanneilnix@gmail.com comment:5

status: pendingnew

Thanks for the input, I updated the jsfiddle to setTimeout in the callback for the fadein. http://jsfiddle.net/Y5F7C/3/

I'm still getting the issues with the stock Android browser on 2.3.4 though.

The page loads, and then after about 7 seconds (when the animation would start) the browser crashes and dumps me back to the home screen.

Changed September 17, 2012 07:13PM UTC by dmethvin comment:6

component: unfiledeffects
priority: undecidedlow
status: newopen

Well, that DOES sound like a crash. :)

I can't repro it on Android 2.3.6 using either the original or revised fiddle though. I'll mark the ticket open and see if we can find someone else who also encounters this in 2.3.4.

Changed October 01, 2012 03:51PM UTC by alanneilnix@gmail.com comment:7

Hey Guys - just checking to see if this has been reproduced yet. I'm still having the issue on the latest build.

Changed October 02, 2012 01:48AM UTC by dmethvin comment:8

I have a real Nexus One with 2.3.6 which works fine. I ran the emulators for Droid Razr (2.3.5) and the Moto Defy Plus (2.3.4) and both are working. So no repro yet.

Just to be clear, you're saying that this test case using jquery-git.js (the most recent build) crashes back to the home screen after 7 seconds when the animation starts:

http://jsfiddle.net/Y5F7C/3/ (add show to the URL to remove jsfiddle UI)

Changed October 04, 2012 10:09AM UTC by jason@cubedthree.com comment:9

I've received reports of this error too from a couple of our users running. One was using Android 2.3.5. Their UA is shown as:

Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; PantechP9070 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

So maybe it's the specific phone or specific build of Webkit? But it definitely appears to be related directly to the fade transition because we are doing something almost identical to what was reported in the jsfiddle provided by alanneilnix, and the user is reporting the same crash error.

Changed October 04, 2012 10:11AM UTC by jason@cubedthree.com comment:10

Replying to [comment:9 jason@…]:

I've received reports of this error too from a couple of our users running. One was using Android 2.3.5. Their UA is shown as: Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; PantechP9070 Build/GRJ90) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 So maybe it's the specific phone or specific build of Webkit? But it definitely appears to be related directly to the fade transition because we are doing something almost identical to what was reported in the jsfiddle provided by alanneilnix, and the user is reporting the same crash error.

As an additional note, this bug does not occur in 1.7.2, however, does in 1.8.1 and 1.8.2.

Changed October 31, 2012 07:13AM UTC by crowkeep@gmail.com comment:11

I'm seeing this crash behavior across a spectrum of Japanese carrier issued handsets (au/DoCoMo/SoftBank), using jQuery 1.8.2.

I'm seeing crashes occur as outlined in the conditions above in the following models, thus far:

'IS11PT', 'N-01D', 'L-01D', 'F-10D', 'ISW13'

All of the above are either Android 2.3.4/2.3.5 excepting the ISW13 which is Android 4.0.3

Mozilla/5.0 (Linux; U; Android 2.3.4; ja-jp; IS11PT Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1

The above is the only full user agent string I can currently grab (I'll try and fill in the others when I get a chance).

Changed October 31, 2012 08:59PM UTC by anonymous comment:12

Seeing the same thing, crashes on a T-Mobile myTouch running Andorid 2.3.6

Changed November 05, 2012 11:09PM UTC by luke@lukemelia.com comment:13

I've confirmed this crashing bug on an LG Esteem running Android 2.3.4 and simplified the fiddle: http://jsfiddle.net/Y5F7C/12/

Perusing the commits since 1.7.2, I'd guess it is this one: https://github.com/jquery/jquery/commit/58ed62ed12cb48d9224f699e86e197804ca5ece4#src/effects.js

Changed November 06, 2012 12:16AM UTC by dmethvin comment:14

_comment0: I've narrowed this down to this line of code: \ \ https://github.com/jquery/jquery/blob/58ed62ed12cb48d9224f699e86e197804ca5ece4/src/effects.js#L93 \ \ and specifically the "|| 0". If anyone is reading this who has insight into what this bit is supposed to be accomplishing, please chime in1396302472031887

I've narrowed this down to this line of code:

https://github.com/jquery/jquery/blob/58ed62ed12cb48d9224f699e86e197804ca5ece4/src/effects.js#L93

and specifically the || 0. If anyone is reading this who has insight into what this bit is supposed to be accomplishing, please chime in

Changed November 06, 2012 12:57AM UTC by gibson042 comment:15

The || 0 forces percent to be numeric and lets us complete the animation when the preceding division yields NaN (e.g., from 0 duration). Can you describe the problem in more detail?

Changed November 06, 2012 04:54PM UTC by luke@lukemelia.com comment:16

I've posted some more information and a proposed fix as a Pull Request here: https://github.com/jquery/jquery/pull/1019

This is clearly a browser bug, and a pretty bad one. Here is a fiddle without jQuery included at all that will crash browsers with this bug: A simple example (without jQuery) of JS that will trigger this crashing browser bug is here: http://jsfiddle.net/wCQvh/

Changed November 06, 2012 05:58PM UTC by anonymous comment:17

My Android 2.1-update1 phone has no issues with any of these fiddles.

Changed November 06, 2012 06:05PM UTC by gabriel@yapp.us comment:18

Here are two jsPerfs that compare the performance of the different ways to perform the offending calculation identified by Luke. This one will cause the crash on affected devices.

http://jsperf.com/ab0/2

This one removes the offending calculations and does not crash on affected devices.

http://jsperf.com/ab0/3

Changed November 08, 2012 03:30AM UTC by dmethvin comment:19

_comment0: Unroll the ( || ) in the math - Fixes #12497 - Thanks @lukemella @curiousdannii - Closes gh-1019 \ Changeset: 877306738f931a711c41d907e69fc8930f9858301353507669354894
resolution: → fixed
status: openclosed

Unroll the ( || ) in the math - Fixes #12497 - Thanks @lukemella @curiousdannii - Closes gh-1019

Changeset: 877306738f931a711c41d907e69fc8930f985830

Changed November 08, 2012 03:33AM UTC by dmethvin comment:20

_comment0: Unroll the ( || ) in the math - Fixes #12497 - Thanks @lukemelia @curiousdannii - Closes gh-1019\ (cherry picked from commit 877306738f931a711c41d907e69fc8930f985830) \ Changeset: 70f662bac5de1ed76021e31387bd4d3aa2e41f661353517713160771

Unroll the ( || ) in the math - Fixes #12497 - Thanks @lukemelia @curiousdannii - Closes gh-1019

(cherry picked from commit 877306738f931a711c41d907e69fc8930f985830)

Changeset: 70f662bac5de1ed76021e31387bd4d3aa2e41f66

Changed November 08, 2012 03:34AM UTC by gnarf comment:21

milestone: None1.8.3

Changed November 08, 2012 11:40PM UTC by anonymous comment:22

That was a nasty bug!!!!!!!!

Changed November 09, 2012 02:49AM UTC by anonymous comment:23

Confirmed it was happening to me as well with Android 2.3.6 Samsung Mobile Boost